Learn HTML Forms by Building a Registration Form - Step 23

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

Hi, Everyone, I have a question. I believed my code passed, only I want to ask is about the value for the pattern attribute. It says give the pattern attribute
this value [a-z0-5]{8,} . I get it for the value “a-z”, and the “8” is for the length of the password. but 0-5? why only to 5 ? why not 0-9?

Thank you

Your code so far

<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <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 method="post" action='https://register-demo.freecodecamp.org'>

<!-- User Editable Region -->

      <fieldset>
        <label for="first-name">Enter Your First Name: <input id="first-name" type="text" required /></label>
        <label for="last-name">Enter Your Last Name: <input id="last-name" type="text" required /></label>
        <label for="email">Enter Your Email: <input id="email" type="email" required /></label>
        <label for="new-password">Create a New Password: <input id="new-password" type="password" pattern="[a-z0-5]{8,}" required /></label>
      </fieldset>

<!-- User Editable Region -->

      <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/114.0.0.0 Safari/537.36

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

Link to the challenge:

That’s just what the instruction or the task required. In building your own app. you can design it to suit what you want.
That’s you can extend the integer to “9”. It’s not a must the integer will stop at " 5".
I hope my explanation was explicit, if you still have any (iota) confusion, hit the reply button and I will attend to you.
Happy coding…

Hi, @CNwante ,thank you for your reply.
One more question, so if here we put 0-5 means the number from 1-10, we can only key in number from 0-5? If 6, 7, is not valid?

That means from the number 0 to 5 not 1 to 10

When you give your pattern a value of 0-5, it means it can only accept numbers ranging from 0 to 5, if you key in any number (e.g: 6,7,8, and 9) outside this range it will not accept it, but if you set the range from 0-9 it means it can accept any number provided the integers keyed in is within the password length
I believe this later answer further clears your doubt. If you still have any question, don’t hesitate to hit the reply button. Someone is likely to attend to you if I am not available.
Happy Coding…

@Irischen , if you don’t mind you connect with me. I am open for connection.
Thanks.

1 Like

Hi @CNwante , sure. Thank you. I’d like to. But I’m new here… can’t find the connect button.:sweat_smile:

Tap or click on my photo icon, you will see a button to message me.
I think this has also added to your knowledge on how to use the platform.
Thank you for accepting, can’t wait to add you to my network.

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