Validating password using javascript


validate Empty ( ) The function below checks if a required field has been left empty.If the required field is blank, we return the error string to the main function.We want to allow only letters, numbers and underscopes.

validating password using javascript-50

Also, the @ must not be the first character of the email address, and the last dot must at least be one character after the @ sign.

At first we check if the user entered anything at all in the email field.

We will check the password strength using a few regular expressions with j Query.

Figure 1: Displays the Password text field Calculating the Password Strength: We need to think of some rules for the password, so that we can evaluate the password strength based on those rules.

Any interactive web site has form input - a place where the users input different kind of information.