freeCodeCamp Challenge Guide: Create a Form Element

Create a Form Element


Problem Explanation

A <form> is an element used to gather infomation directly from the user’s input. When you use this HTML element you are identifying a section used to collect the user choices.

Inside this HTML element, you might insert a few input tags, used to collect data in different ways based on the type attribute.

All of this data will be sent to the page specified in the action attribute of the form. This is simply a relative path that indicates the page that expects to receive this data.

In this challenge, you already have an input element. All you need to do is wrap a form tag around it. Do not forget the action attribute. Use the value indicated by the challenge (doublecheck the syntax).

Good luck!

72 Likes

I dont understand the nest part

34 Likes

The challenge wants you to make the input field a child element of a form element.

A similar instruction might ask you to nest a paragraph element within a div and the code would look like this:

<div>
  <p>Here is a nested p element</p>
</div>

Does that make sense?

47 Likes

Hi

I am still having trouble with the nesting part

24 Likes

no matter
, , , , , , , ,

6 Likes

yea im trying to understand nesting cant really figure that part out

12 Likes

This means the text input sits inside of the form element.

If you have a form, your HTML may look like this:

Everything between those two tags is “nested” inside the form.

So, if you were to nest the text input element within the form element, it would look like this:

5 Likes

The challenge is saying to nest the INPUT into the FORM.
So:

form>
<input code=“blah blah”

</form

The example makes this kinda confusing.

15 Likes
<form input type="text" action="/submit-cat-photo"

here’s a right answer

23 Likes

Create a Form Element
Here is my response in the code editor to the instructions given, but I can not move forward, please help.

8 Likes

Need help with this lesson, I have added the following code but can not seem to move forward.

7 Likes

you have to nest the text input with the form element.
form action=/submit-cat-photo
input type="text"placeholder=“cat photo URL”
/form
dont forget the <>

26 Likes

Have been stuck like 30 minutes and still nothing…

<form action="/submit-cat-photo" input type="text" placeholder="cat photo URL"
10 Likes

this worked for me. you can find out here

https://github.com/freeCodeCamp/freeCodeCamp/issues/3628
17 Likes

Solution for ‘Create a Form Element’: <form action="/submit-cat-photo"><input type="text"></form>

51 Likes

Thank you! This solution works.

26 Likes

Yes the code that nicedrop wrote works for me too!

2 Likes

The answer is:

<form action="/submit-cat-photo"><input type="text"  placeholder="cat photo URL">
</form>
44 Likes

Thanks for the Solution for ‘Create a Form Element’:

1 Like

but the example above is very different from your answer

1 Like