I dont know, how to put it correct?

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

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

Challenge: Create a Form Element

Link to the challenge:

Click the ‘Reset All Code’ button to start the challenge over fresh.

The only thing you want to do is put opening/closing form tags around the existing input (this is what nest means) and then add the URL given in the instructions as the value of the action attribute on the form.

The example shows you exactly how to do this:

<form action="/url-where-you-want-to-submit-form-data">
  <input>
</form>

You replace “/url-where-you-want-to-submit-form-data” with the URL in the instructions.

<input> in the example above is just an example of an input tag. The one you will want to use is the one that is already in the challenge HTML.

So I put the code in this way

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

The error that it shows is
" The existing input element should be nested within a form element."

So did you leave the existing <input> exactly the way it is? Do not change one thing about the existing <input>. All you are doing is putting opening/closing form tags around it.

If you still feel you are doing it correctly then you will have to paste your new HTML in here so we can see it.

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

This is the code that I put it in

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.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

1 Like

Again, start over fresh with the ‘Reset All Code’ button.

I cannot stress the following enough :slight_smile: Do not change any of the existing HTML. You are only adding the beginning/closing form tags around the existing input element.

Your closing form tag is fine. Now make sure the opening form tag is correct.

Sir,
Thank you so much for helping me out here.

I put the same code as you asked

form action= “https://freecatphotoapp.com/submit-cat-photo”>

The error message is

The existing input element should be nested within a form element.

Your form should have an action attribute which is set to [https://freecatphotoapp.com/submit-cat-photo](https://freecatphotoapp.com/submit-cat-photo)

Your form element should have well-formed open and close tags.

Again I just copied and pasted your code, and it seems to be not working

I think there might be some miscommunication here :slight_smile: Just to be clear, I haven’t given you any code to copy/paste. The only things I have given you are these instructions:

  • Click the “Reset All Code” button to start over.
  • Do not change any of the existing HTML.
  • Only add the opening/closing form tags around the existing input and set the action attribute on the opening form tag to the URL specified in the instructions.

That’s it. That’s all you need to do to pass this challenge.

Now I did paste in the example HTML from the instructions earlier, but that is just an example, not the answer. You should use that as an example of how to do the last step above. And if you want to copy/paste the form tags from that example into the challenge code that is fine, but you have to change the action attribute to what is requested in the instructions.

Sir it not working,

Ok lets start over,

The task asked is

‘Nest the existing input element inside a form element and assign "[https://freecatphotoapp.com/submit-cat-photo](https://freecatphotoapp.com/submit-cat-photo)" to the action attribute of the form element.’

The code I entered is

  1. flea treatment
  2. thunder
  3. other cats

And the error it is showing is

'Your form should have an action attribute which is set to [https://freecatphotoapp.com/submit-cat-photo](https://freecatphotoapp.com/submit-cat-photo)'

And before I enter the code, I reset the lesson

Thanks in millions for your help

Naveed