Having trouble learning pod for creating form

Tell us what’s happening:
I seem to be unable to get past the last element below… creating a form. Can you see what i’ve done incorrectly. It keeps telling me my text input tag needs to be nested in a <form tag… but i have done that.

Any advice would be appreciated.

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">

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


</main>

Your browser information:

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

Challenge: Create a Form Element

Link to the challenge:

there is nothing inside your form tag

to put something in an element you need to insert it between the opening and closing tags

Sorry, don’t understand. I’ve indicated “input type” and “action” according to the info in the lesson.

but you need to put the input element inside the form element, input is not a valid attribute for form
(you wrote input inside the opening tag, but you instead need to put the opening <form> tag before the existing input element, and the closing </form> tag after the existing input element)

ieahleen, sorry but i’m afraid, i apparently am still getting in wrong. This is what i thought you meant:

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

Can you please correct my error so i can see my mistake as i apparently do not completely understand the terms you are referring to.

Thanks , Stephan

Ieahleen,

I put this in my reply on the “chat” system, but I don’t know if it showed at your end. This is what I thought you meant in your earlier reply.

It still seems to be coming up wrong! Could you please correct what I’m doing so I can see my actual error as it appears I am not understanding the “terms” you are referring to.

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

Thanks for your help… much appreciated as I am new to this concept of online learning.

Stephan

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

this is your opening tag
you should remove theplaceholder, input and type attribute as they are not valid for a form tag

this is your closing form tag

there is nothing between them so your form elemebt is still empty

this is the existing input element that you are asked to put inside the form tag, so between the opening and closing tag

Ilenia,

I’m afraid I apparently still don’t get it! So this will be my last attempt at understanding what needs to be done.

First, this is the actual dialogue from the module:

Basic HTML and HTML5: Create a Form Element

You can build web forms that actually submit data to a server using nothing more than pure HTML. You can do this by specifying an action on your form element.

For example:

Nest your text field inside a form element, and add the action=“https://freecatphotoapp.com/submit-cat-photo” attribute to the form element.

I have done this as shown below. I do understand the nature of the open and closing form tags.

<form

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

So far, so good…. Now the problem. After running the test, I get the following response:

// running tests

Your text input element should be nested within a form element.

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

// tests completed

I assume that it is now asking me to integrate the previous element of code from the last lesson into the form:

This is where I have the problem, since you have advised that input and placeholder tags do not go into I am at a loss as to how to integrate this piece of code. May I request that you simply write the entire code between the two form tags <form……….

Thanks

Stephan

Hello and welcome.
You need to have your input tag inside your form tag.
The structure for this challenge should be like this:

<form ...........................>
  <input ..............................>
</form>

Solution:

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

to put something inside an element you need to put it after the opening tag of the element and before the closing tag of the element, if there is nothing between the two, then the element is empty

so, what’s between the opening and closing tag of your form element?
nothing, because there is the > of your opening tag, and then the < of your closing tag, nothing in between, you should have something in there…

Thank you… i’ve been at this for several hours and finally a result and the ability to move on!!! Hooray.

Stephan

Ilenia,

Thanks finally got it…

Stephan

Ilenia,

Finally got it…. Thanks for all your efforts and patience….

Stephan