Next, we use regular expression and the test() method to check the field for a compliance.
validate Password ( ) The function below checks the password field for blankness and allow only letters and numbers - no underscopes this time.
validate Email ( ) Next we want to see if the email address the user entered is real.
This means that the input data must contain at least an @ sign and a dot (.).
So we should use a new regular expression to forbid underscopes. Next, we want to permit only passwords that contain letters and at least one numeral.
For that we use the seacrh() method and two more regular expressions: /(a-z) / and /(0-9)/.