How i create form action

Tell us what’s happening:
am having issue with nesting input in form action

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="https://freecatphotoapp.com/submit cat photo">
<input type="text" placeholder="cat photo URL">
</form>
</main>

Your browser information:

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

Challenge: Create a Form Element

Link to the challenge:

Hi Kizito, it’s not the nesting that is the issue. Check the URL that you have in the action attribute. Just copy paste the one they give you if it helps.

That said, when nesting you should indent the elements that are nested to make it easier to read. E.g.

<form>
   <input>
</form>

That’s not the reason the test is failing, it’s just best practice.

1 Like

Please can you help put down the correct code for me because am still confused

Sure, you should do it like this:

<form action="https://freecatphotoapp.com/submit-cat-photo">
  <input type="text" placeholder="cat photo URL">
</form>

The problem was you missed out the dashes in the url. It should be submit-cat-photo

Thank you so Much, I wish I have your contact so that you can assist me further cause am still novice.

you can always post on the forum with your questions and help requests, isn’t it better to have multiple people for help!

I understand now, thank you

You have to learn backend PHP or python to know more about form action.

the freecodecamp curriculum teaches NodeJS for backend

Its gradual cause I started new, I hope to be better

I will later when I reach the stage to avoid confusion

The back end is still further as in I will meet it in later stage

Check your URL address. -there -should -be -no-spaces-between-words.
(“https://freecatphotoapp.com/submit-cat-photo”) Keep coding friends!