Learn HTML Forms by Building a Registration Form - Step 21

Tell us what’s happening:
Describe your issue in detail here.

please how do i add the value for the pattern attribute
Your code so far

/* file: index.html */
<!DOCTYPE html>
<html lang="en">
  <meta charset="UTF-8">
  <title>Registration Form</title>
  <link rel="stylesheet" href="styles.css" />
  <h1>Registration Form</h1>
  <p>Please fill out this form with the required information</p>
  <form action='https://register-demo.freecodecamp.org'>
      <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>
    <input type="submit" value="Submit" />
/* 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/ Safari/537.36

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

Link to the challenge:

in HTML, an attribute is a special key-value pair that usually looks like this


So whenever someone mentions an attribute, you need to remember this formatting. Here a pattern attribute will be added to the input element. (Similar to how ‘type’ is an attribute, you need to add it inside the input element’s start tag)


@eyehifeanyichukwu here pattern attribute has “[a-z0-5]{8,}” but you have the error “[a-z0-5]{8,)”

just change the “)” to “}”

also just noticed that you did add the pattern attribute but you didn’t leave a space in between it and the previous attribute

1 Like

thank you @hbar1st , @Rockky1997

1 Like

you are welcome @eyehifeanyichukwu

I´ve found that most of errors are due to misspellings, lack of closing tags, etc.
The question above doest not match the Challenge 21. I think this would be on a next step.

The answer to Building a Registration Form - Step 21 is: < input id=“new-password” type=“password” minlength=“8” required/> (without the space between < and imput word, other wise the Preview on THIS PAGE shows the input field instead of the solution´s text)

Tell me what to do, please.

Enter Your First Name: Enter Your Last Name: Enter Your Email: Create a New Password:

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