Getting errors on the checking task

I keep getting the following errors:

You should not change the inner text of the Indoor label.
You should not change the inner text of the Loving label.

How can I add a check for the two specified without changing the inner text?
Even when I copy+paste the “solution” from the video I still get the same errors!!

  **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://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" 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" checked> Indoor</label>
  <label><input type="radio" name="indoor-outdoor"> Outdoor</label><br>
  <label><input type="checkbox" name="personality" checked> 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>
  **Your browser information:**

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.1 Safari/605.1.15

Challenge: Check Radio Buttons and Checkboxes by Default

Link to the challenge:

Your Answer is correct, but some of the Base tutorial Code has been deleted in your answer:


Go Ahead and RESET the tutorial, and give your answer again.

1 Like

Ok, I reset the code, put the checked> back in the correct places and still get the same errors. This is very odd! Slightly frustrating as I’m nearly done with this bank of tests. Really appreciate the help though thank you!

Hi @spw,

@ALLESS is right, you removed few things from the original code: the for attributes for your label tags, the id and value attributes for your input tags.

Example in your code:

<label>
  <input type="radio" name="indoor-outdoor" checked> Indoor
</label>

Example in the original code:

<label for="indoor">
  <input id="indoor" type="radio" name="indoor-outdoor" value="indoor"> Indoor
</label>
2 Likes

Thanks so much for the clarification, I appreciate it.

I’ve tried everything I can think of at this point, resetting the code, copy & pasting the entire solution code. Still getting the same errors. Moving on to something else

One thing that hasn’t been tried yet… Go ahead and post the most updated code, and let us have a look at it…

There may be more that can be done.

The Forums are here, to help ensure your Success…

Thanks Alless, I didn’t want to take up anybody’s time (or my own) anymore so I jumped forward one exercise and borrowed the starting code from that to solve the issue. Cheating I know. I looked at the solution code and couldn’t spot what I’d done incorrectly. I’ve obviously cheated myself out of a valuable lesson but hey. Thank you again for your help

My suggestion to you then: Is to go through the lessons after you’re done with them, after your more comfortable with reading and writing code, And make sure there isn’t a gap in your knowledge.

I think I’ve done the whole tutorial set for the Responsive Web Design like ten times… without logging in. It helps to repeat it, if you feel the need to skip through.

Another thing to remember, that if you become Employed as a Dev, there will be the Expectation that you can follow along with instruction…and ask for help from other people…

It may be best to start training your Brain now to deal with those aspects, instead of later…

Great advice and it appears I’m now making the same mistake on later tasks. What I’m also finding is that “reset all code” doesn’t completely reset the code ie, it keeps the code with my mistakes in, therefore; that’s the root cause of what’s making me fail.

I’ll definitely run through these lessons again. As you can probably tell I’m a noob!

The issue is just that you changed the original code, I gave you an example. You just needed to add two checked for two input tags without change anything in the original code. I can give you more details if you want in taking one part of your code.

<label>
  <input type="radio" name="indoor-outdoor" checked> Indoor
</label>

The code is not wrong, it will print something, but it is not the good way to do:

  • To associate your label with your input, you need a way to connect them. How? By using the attribute for for the label and the id attribute with your input, both of them with the same value. Example in the original code:
<label for="indoor"> <!-- You have the for attribute -->
  <!-- You have the id attribute with the same value than the for attribute in the label -->
  <input id="indoor" type="radio" name="indoor-outdoor" value="indoor"> Indoor
</label>
  • The challenges are sensitives to any kind of changes you will do, that is why it is good to only submit what is asked. According to the code you shared, I would say that you tried to type everything again by your own to practice, and it is good to do so, but you can maybe do this after you did the challenge (it is just a suggestion).

It is good to not stay stuck and move on, but as you are learning, it is better to try to understand the issues you are meeting, and you can ask any kind of questions on the forum if you don’t understand something, many people would be pleased to help you @spw :slight_smile:

1 Like

This is great feedback, thank you for taking the time to help me understand. I’m really impressed by how helpful folk are here!

I agree I should’ve resolved my misunderstanding before moving on. I have an interview to take a coding course soon and I wanted to show them evidence of progress I’ve made by myself but perhaps I should slow down a little and absorb the lessons fully.

1 Like

You are welcome @spw, you do the effort to ask help so people do the effort to help you. About the learning, it is like in sport, it is better to do five good push-ups than twenty bad ones. :wink:

No matter the time you spend on one lesson, you should pass to the next one in having fully understand the previous one, like this you avoid to create shortcomings that could be avoid just in spending few minutes more on an issue.

I wish you the best of luck for your interview, I am sure you will do great so keep the hard working mind! :smiley: