Stuck on step 41 of making a registration form

The error:

“You should give the input expecting a first name a name attribtute. PS I would have chosen first-name

The code:
https://pastebin.com/ZR3cquCK

As you can see, the inputs with the first-name,last-name etc already have ‘name’ attributes. But I still keep getting the error to add a name attribute to the inputs despite them having it. Why is the code wrong? Did I miss something?

Welcome to our community!

The instruction: " Give each submittable element a unique name attribute of your choosing, except for the two radio inputs."
The “submittable” elements are input elements with ‘type’ attributes set to “file” and “number”, the ‘select’ element, and ‘textarea’ element.

I’m not sure what you mean. All input fields have name elements attached to them and should pass the check.

Thanks for taking the time to write, I am excited to be part of the community!

<input id="profile-picture" type="file"/>
Where’s the name attribute :slight_smile:

Where is the ‘name’ attribute?

This is your code:

 <label for="profile-picture">Upload a profile picture: <input id="profile-picture" type="file"/></label>

 <textarea id ="bio" rows="3" cols="30" placeholder="I like coding on the beach..."></textarea>

i have added the name attribute but the error is still the same:

You should give the input expecting a first name a name attribtute. PS I would have chosen first-name

I am really not sure what I am doing wrong, I am trying to add name attributes but the error still remains

the first name bit of code already has a name attribute, why won’t the code pass? (or move on to the next error so i can fix those)
code in question:

<input id="first-name" name="first-name" type="text" required/

Post all your html and css code here.

HTML: <!DOCTYPE html><html lang="en"> <head> <meta charset="UTF-8"> <ti - Pastebin.com
CSS: body { width: 100%; height: 100vh; margin: 0; background-color: #1b1 - Pastebin.com

The code for the step 41 has passed on my side, although you doubled ‘name’ attribute in the following code line:

         <label for="age">Input your age (years): <input id="age" type="number" min="13" max="120" name="age" name="age"/></label>       

But, the whole problem lies in this line:

 <name file></name    ---- where did you find the instruction to put this into code
1 Like

Hmm! it passed!

somewhere earlier an instruction suggested giving the file a name but I think I did it wrong, but it passed anyway. Thanks a lot.

Can you explain to me why changing the causes issues?

The ‘name’ is an attribute, not an Html element. It can not be used as you tried to use it. Also, if any HTML element stays without any angle bracket < or > this will be reported as an error.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.