Learn HTML forms by Building A Registration Form- Step 39

Step 39

Link the applicable form elements and their label elements together.

Use profile-picture, age, referrer, and bio as values for the respective id attributes.

Profile Picture:



Age:



Referrer:



Provide a bio:


Above is my code.

I have tried entering the above code I want however it comes up with "The first input element should have an id of profile-picture ".

Look forward to your replies.

Hi @fitzgeraldp , welcome to the forum.

To post your code to the forum, wrap your code inside ``` and ``` (3 backticks) to make it preformatted.

Also, post the link to the exercise for better assistance.

Learn HTML Forms by Building a Registration Form: Step 39 | freeCodeCamp.org

Please post your code, too.
Remember to wrap your code inside ``` and ``` (3 backticks) to make it preformatted.

For the next time, you can press “Help” button to create a help post on the forum

image

Hey there,

Please update the message to include your code.
When you enter a code, 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 (').

‘’’ Profile Picture:



Age:



Referrer:



Provide a bio:


‘’’

“”" Profile Picture:



Age:



Referrer:



Provide a bio:


“”"

@fitzgeraldp This is the backtick key:

image

  <label for="profile-picture">Profile Picture:</label>
            <input type="file" id="profile-picture" name="profile-picture">
            <br>
            <label for="age">Age:</label>
            <input type="number" id="age" name="age">
            <br>
            <label for="referrer">Referrer:</label>
            <input type="text" id="referrer" name="referrer">
            <br>
            <label for="bio">Provide a bio:</label>
            <textarea id="bio" name="bio" rows="4" cols="50"></textarea>
            <br>

Ok. The instruction asked you to link the label and form elements on the existing code for the existing form.

What you did is you created a new form elements with new labels.

Click the Reset button to reset the code and do it again.

Hi Toan

Thanks. I have am really stuck I have tried creating code possibilities without success. Are you able to give me an example? Cheers Patrick

Hi Toan

WOuld this be it - “”<input id="profile-picture" type="file" /></label>`Preformatted text

First, you need to reset the code.

Then, set id for input, select, textarea with the given values in the instruction.

Then, inside the <label> openning tag, set the for attribute with the respective values.

Here is an example to link a label with an input element:

<label for="fullname">Fullname: <input type="text" id="fullname"></label>

Got it thanks for your help. Cheers

1 Like