freeCodeCamp Challenge Guide: Create a Form Element

freeCodeCamp Challenge Guide: Create a Form Element
0

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!

2 Likes

I dont understand the nest part

6 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?

7 Likes

Hi

I am still having trouble with the nesting part

1 Like

no matter
, , , , , , , ,

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

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:

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

form>
<input code=“blah blah”

</form

The example makes this kinda confusing.

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

here’s a right answer

3 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.

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

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

7 Likes

Have been stuck like 30 minutes and still nothing…

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

this worked for me. you can find out here

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

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

37 Likes

Thank you! This solution works.

11 Likes

Yes the code that nicedrop wrote works for me too!

The answer is:

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

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

but the example above is very different from your answer