Why is it not working how to nest input inside form element please help i have tried everthing

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

Your browser information:

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

Challenge: Create a Form Element

Link to the challenge:

Hello there and welcome to the forum.

Do you have a question?

If so, please edit your post to include it in the Tell us what’s happening section.

The more information you give us, the more likely we are to be able to help.

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

  </form>

I’m sorry, that last post does not seem to contain a question either. What do you need help with?


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 (’).

Hey @rahuljoshi10 nesting means this:

<div>
<input type="text" name="textbox">
</div>

here input is nested inside the div you are not suppose to put input tag inside the form tag itself but in between the opening and closing form tags just like here input is between opening and closing div tag

1 Like

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="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 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36.

Challenge: Create a Form Element

Link to the challenge:

what’s your question? what issue do you have? what kind of help do you need?

thanks but it is resolved now. i was nesting input tag inside form but it was showing test failed again and again. It was a bug i guess because after re login it got resolved.

1 Like

Hi @rahuljoshi10. I think it’s not a bug because the code you first provided has some mistakes in it:

There is an extra space after the form.

You don’t have a < at the start and you removed the placeholder attribute. Please only do what’s said in the challenge.

When you logged in again and did the challenge again, you didn’t remove the placeholder attribute and fixed the issues.

Also, I see that you have posted your solution here. Please don’t do so. If other campers see it, they can use it in their code and pass the challenge. If they do so, they will learn only copy-pasting. If you want to post full solutions, please surround it with [spoiler] and [/spoiler] tags.

Happy Coding!

I think you had changed this, and the test failed for that - really common issue, really, accidentally changing something, and that stopping the tests from passing

its working already it was a bug

it’s not a bug, if you change the existing input element the tests do not pass

image

and if I change Cat to cat
image

1 Like

yeah i know the solution, but due to the bug i was trying everything and that 1st program i posted got posted by mistake i know its wrong. and the solution you are talking about , i posted that because it was not working that time… that was the bug you can see that i have nested input correctly in the form element still it was not working and when i restarted it start working.

1 Like

As @ilenia said, the bug was in your code. Resetting the code fixed the changes you accidentally made to the placeholder text.

The smallest differences are actually very big differences to a computer in programming. Computers are pretty bad at understanding what we mean.

2 Likes

This is the same thing I have to tell you. The FCC challenge checks if your code matches the solution and if you change anything that’s not said in the challenge, FCC will show the tests as failed.

This doesn’t mean that you can’t play with your code. You can experiment with your code, but before submitting the answer, please reset the code and do what’s said in the challenge.

Hope you understand!

2 Likes