Kimora
November 7, 2019, 10:29am
1
Tell us what’s happening:
Your code so far
<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><input type="radio" name="indoor-outdoor"> Indoor</label>
<label><input 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>
<input type="radio" name="indoor-outdoor" value="indoor">
<input type="radio" name="indoor-outdoor" value="outdoor">
<input type="checkbox" name="indoor-outdoor" value="loving">
<input type="checkbox" name="indoor-outdoor" value="lazy">
<input type="checkbox" name="indoor-outdoor" value="energetic">
</form>
</main>
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36
.
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
You need to set the value attributes in there.
value=indoor
for instance
ilenia
November 7, 2019, 10:47am
3
you shouldn’t create new input elements, you need to add the value to the existing ones
1 Like
You have to completely remove the last three lines of code. Referring to the three checkboxes that follow the radio input. Once you remove those you have to add values to your current personality attributes above.
the code should look like this:
label input type=checkbox
name=personality
value=loving
Loving /label
(repeat the process for all three personalities)
NOTE that you must use quotation marks for the code as you had done originally !
I had the same problem. I hope I was able to help.
Kimora
November 7, 2019, 3:20pm
6
its not still working yet
ilenia
November 7, 2019, 3:44pm
7
reset your code and add the value attribute to the existing input elements
if still doesn’t work show your new code
Kimora
November 7, 2019, 3:47pm
8
<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">
<input type="radio"name=“indoor-outdoor”>indoor
<input type="radio"name=“indoor-outdoor”>outdoor
<label><input type="checkbox" name="loving"></label>
<label><input type="checkbox" name="lazy"></label>
<label><input type="checkbox" name="enegertic"></label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>
</main>
this is what i have now
Kimora
November 7, 2019, 3:49pm
9
<input type="radio"name=“indoor-outdoor”>indoor
<input type="radio"name=“indoor-outdoor”>outdoor
<label><input type="checkbox" name="loving"></label>
<label><input type="checkbox" name="lazy"></label>
<label><input type="checkbox" name="enegertic"></label>
ilenia
November 7, 2019, 4:30pm
10
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.
Kimora
November 7, 2019, 4:31pm
11
i sent you a message please check it and revert. thanks @ilenia
ilenia
November 7, 2019, 4:32pm
12
I do not see value attributes anywhere in your code
you where nearer in your first version, at least you had added the value attributes, even if in the wrong place
ilenia
November 7, 2019, 4:36pm
13
you can keep asking questions here, instead of sending me a PM…
Kimora
November 7, 2019, 4:53pm
14
<input type=“radio” name="indoor-outdoor value=“indoor”> Indoor
value=“outdoor”> Outdoor
value=“loving”> Loving
figured it out. need to add the value attribute to radio and check list. thank you every one