Use HTML5 to Require a Field 5

Use HTML5 to Require a Field 5
0
#1

Tell us what’s happening:
Having major difficulties on this one, yet again. I’m trying to go back through all of them and take notes on them, but so far, I’m completely stumped.

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">
    <input type="text" placeholder="cat photo URL">
    <button type="submit">Submit</button>
  </form>
</main>

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/responsive-web-design/basic-html-and-html5/use-html5-to-require-a-field

#2

Input elements have different attributes like type, name, etc. Here they are asking you to add the required attribute to the input element.

As it is right now, your input has 2 attributes; type and placeholder, you just need to add the attribute the challenge is asking for.

For mor info https://www.w3schools.com/tags/att_input_required.asp

#3

Hi,

What they are telling you to do is to make sure users fills the <input> before he can submit, and to do it, you will add required within your input tag, just like this:

<input type="text" placeholder="cat Photo URL" required >

I hope you get this?

Happy coding!

#4

I got it once I reviewed a video on scrimbia. I’m using that video website to figure out how to do things now so I can take notes. But thank you anyways! :smile:

1 Like
#5

Thanks also, the first time hearing scrimbia. You contributed to my knowledge also!

#6

You’re welcome :smiley: I was told about scrimbia by someone on another post of mine, and it’s very helpful. Here’s the link to the website for more help:

https://scrimba.com/

1 Like