Bild96
March 27, 2020, 2:14pm
1
Tell us what’s happening:
couldn’t complete the task. I don’t know where is the error
Your code so far
<textarea placeholder="Allergies, and extra information"></textarea><br>
<button type="submit">Order Sandwich</button>
</form>
<h2>CatPhotoApp</h2>
<main>
<p>Click here to view more <a href="#">cat photos</a>.</p>
<a href="#"><img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."></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">
<label for="indoor">
<input id="indoor" value="indoor" type="radio" name="indoor-outdoor">Indoor
</label>
<label for="outdoor">
<input id="outdoor" value="outdoor" type="radio" name="indoor-outdoor">Outdoor
</label>
<br>
<label><input type="checkbox" name="personality" value="loving"> loving</label>
<label><input type="checkbox" name="personality" value="lazy"> lazy</label>
<label><input type="checkbox" name="personality" value="energetic"> energetic</label><br>
<textarea placeholder="loving, lazy, energetic"></textarea><br>
<button type="submit">personality</button>
</form>
Your browser information:
User Agent is: Mozilla/5.0 (X11; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0
.
Challenge: Use the value attribute with Radio Buttons and Checkboxes
Link to the challenge:
https://www.freecodecamp.org/learn/responsive-web-design/basic-html-and-html5/use-the-value-attribute-with-radio-buttons-and-checkboxes .
One of your checkboxes should have the value
attribute of loving
.
One of your checkboxes should have the value
attribute of lazy
.
One of your checkboxes should have the value
attribute of energetic
.
You should not have changed the text inside the tags (their contents).
Bild96
March 27, 2020, 9:04pm
3
<h2>CatPhotoApp</h2>
<main>
<p>Click here to view more <a href="#">cat photos</a>.</p>
<a href="#"><img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."></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">
<label for="indoor">
<input id="indoor" value="indoor" type="radio" name="indoor-outdoor">Indoor
</label>
<label for="outdoor">
<input id="outdoor" value="outdoor" type="radio" name="indoor-outdoor">Outdoor
</label>
<br>
<label><input type="checkbox" name="personality"> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Energetic</label><br>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>
</main>
I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>
) will also add backticks around text.
Note: Backticks are not single quotes.
Is your code passing now? If not, what tests are failing?
Bild96
March 27, 2020, 9:07pm
6
I got those error : One of your checkboxes should have the value
attribute of loving
.
One of your checkboxes should have the value
attribute of lazy
.
One of your checkboxes should have the value
attribute of energetic
.
None of your checkbox input
s have a value
.
<label><input type="checkbox" name="personality"> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Energetic</label>
Bild96
March 27, 2020, 9:10pm
8
Where should I make the changes !
You have input
s with type “checkbox”. You need to give each one a value
attribute.
Bild96
March 27, 2020, 9:15pm
10
still same , I don’t know what should I replace or make the change
Show me where the value
property is.
That’s the name
property.
Look at the example code. It tells you how to add a value
property. Currently your input
s only have two attributes: type
and name
.
Bild96
March 27, 2020, 9:38pm
16
got it now, I got confused because of the order of the lines
Good job figuring it out. Happy coding!
Bild96
March 27, 2020, 10:44pm
18
only loving get through the rest 2 are wrong why ??!
Loving
lazy
<input id=“energetic” value=“energetic”
type=“checkbox” name=“personality”>energetic
Why did you change “Energetic” to “energetic” inside the tag? You should only change the value
.
1 Like