Learn HTML Forms by Building a Registration Form - Step 20

Hi all,

I am once again struggling to understand where I am going wrong with this task.

It is asking me to add a pattern to the input and I am still lost with how to get round this??? I’ve put in everything it needs so far and still nothing is coming out correct at all.

Could I have some help please, as this task is challenging to say the least.

Many Thanks

   **Your code so far**
/* file: index.html */
<!DOCTYPE html>
<html>
 <head>
   <title>Registration Form</title>
	  <link rel="stylesheet" href="styles.css" />
 </head>
 <body>
   <h1>Registration Form</h1>
   <p>Please fill out this form with the required information</p>
   <form action='https://register-demo.freecodecamp.org'>
     <fieldset>
       <label>Enter Your First Name: <input type="text" required /></label>
       <label>Enter Your Last Name: <input type="text" required /></label>
       <label>Enter Your Email: <input type="email" required /></label>
       <label>Create a New Password: <input type="password" pattern="[a-z0-5] {8,}" required ></label>
     </fieldset>
     <fieldset></fieldset>
     <fieldset></fieldset>
     <input type="submit" value="Submit" />
   </form>
 </body>
</html>
/* file: styles.css */
body {
 width: 100%;
 height: 100vh;
 margin: 0;
 background-color: #1b1b32;
	color: #f5f6f7;
}

label {
	display: block;
	margin: 0.5rem 0;
}

   **Your browser information:**

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

Challenge: Learn HTML Forms by Building a Registration Form - Step 20

Link to the challenge:

you should remove the existing attribute identified in the instructions, then add the new attribute given in the instructions with a value of the given regular expression

So all I have to do is replace the attribute password with pattern attribute and give it the value of [a-z0-5] {8, }.

Did it work? your code looks fine but the space between the arrray and curly braces may cause tests to fail

No sadly. It is telling me “You should give the password input element a pattern attribute.” I have even tried giving it a value attribute as well. I am still new to all this and I am learning slowly.

Just be patient with your self and remain calm. what you have done is correct but there is a space between 5] this space {8

So all I need to do is add a space between the 5 and ] and the 8 and .

no you need to remove the space so the ]{ hug each other

Ok, thank you, I will try this method out now.

1 Like

I’ve tried it and it is still saying I am wrong.

try giving your input element a self-closing tag, like this />

Sadly, still nothing I will restart the lesson and go from the start.

yes maybe that will work

Ok, all reset and ready to go again.

1 Like

You should add “name " attribute to the input tag like that:
…“name=“password” pattern=”[a-z0-5]{8,}” …

Hi Anna,

Sorry for my delay in replying to you, I have only just read your message.

Thank you for your help and support, I will give it a try and I will get back to you on this situation if it does not work. But I have faith in people on here willing to help at all times.

Many Thanks,

This is still not working and I don’t know why???

I will continue trying more methods and figure out a way to solve this step. Any help and support is appreciated and taken in to account.

Many Thanks,

I would like to thank everyone for their help on this step. I have finally found out how to solve it. This is my code after I completed this step.

<input type=“password” pattern=“[a-z0-5]{8,}”

2 Likes

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