mardi 20 juin 2017

How to restrict non-alphabetic character to not be the first or last character of a password

So, I have this:

my HTML code

My HTML code is also here for your viewing convenience:

form action = "." method="post"

input type="password" placeholder = "New Password..." name= "password" title = "Password must be at least 8 characters, at least one alphabetic character [a-zA-Z], at least one non-alphabetic character, which is not the first or last character." pattern="(?=.\d)(?=.[a-z])(?=.*[A-Z]).{8,}">

/form

How do I restrict the password so it does NOT accept the first or last characters to be non-alphabetic characters (see "title")?

Example: Password hi123*HI is accepted, but how do I reject hi123HI due to the fact '' is the first character (same issue if '*' was the last character, or special characters or numbers were both the first and last characters).

Thank you.

Aucun commentaire:

Enregistrer un commentaire