Checkboxes by Default

Checkboxes by Default
0.0 0

#1

Tell us what’s happening:

I don’t what i do wrong because i am trying to figure the meaing “your first checkbox on your form should be checked by default.” I wrote the input…in but only the first step it’s avalable.

Your code so far

<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

  p {
    font-size: 16px;
    font-family: Monospace;
  }

  .thick-green-border {
    border-color: green;
    border-width: 10px;
    border-style: solid;
    border-radius: 50%;
  }

  .smaller-image {
    width: 100px;
  }
</style>

<h2 class="red-text">CatPhotoApp</h2>

<p>Click here for <a href="#">cat photos</a>.</p>

<a href="#"><img class="smaller-image thick-green-border" alt="A cute orange cat lying on its back. " src="https://bit.ly/fcc-relaxing-cat"></a>

<p>Things cats love:</p>
<ul>
  <li>cat nip</li>
  <li>laser pointers</li>
  <li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
  <li>flea treatment</li>
  <li>thunder</li>
  <li>other cats</li>
</ol>
<form action="/submit-cat-photo">
  <input type="radio" name="test-name"checked>
  <label><input type="radio" name="indoor-outdoor"> Indoor</label>
  <label><input type="radio" name="indoor-outdoor"> Outdoor</label>
  <label><input type="checkbox" name="personality"> Loving</label>
  <label><input type="checkbox" name="personality"> Lazy</label>
  <label><input type="checkbox" name="personality"> Energetic</label>
  <input type="text" placeholder="cat photo URL" required>
  <button type="submit">Submit</button>
</form>

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36 ASW/4.58.2552.909.

Link to the challenge:


#2

"Your first checkbox on your form should be checked by default."
This is what i am getting wrong…how do i validate that?


#3

You currently have a radio button checked by default, but none of your checkboxes.


#4

And what should i do…i don’t get it. If u know the answer please wrote what i should do. Tnx


#5

@ArielLeslie is trying to help you without just giving you the answer. Do you know the difference between a radio button and checkbox syntax? What part of the error message do you not understand?


#6


The X part


#7

There are 3 checkboxes (inputs with type=“checkbox”):

  <label><input type="checkbox" name="personality"> Loving</label>
  <label><input type="checkbox" name="personality"> Lazy</label>
  <label><input type="checkbox" name="personality"> Energetic</label>

You just need to put the word checked in one of these, just like you did with the radio button input. Why one? The instructions and error message tell you which one.


#8

Thank you kind sir. I understand now.