Password must begin with a capital letter followed by exactly 6 alphanumeric letters followed by a single numeric digit. Write Javascript code to validate this and similarly display error message if violated. Valid: Pabcdef8, J1234567, Ka1b2c39, Invalid: abcdefg9, Abcdefgh, Abcdefg78. I must not be using the right special characters form validation. Can you tell me the format for the password in special characters as shown below? I've bolded the particular part of code.
HTML:
<label for="password"><br>Password:
</label>
<input type="password" id="password"
name="password">*<br><br>
JAVASCRIPT:
function chkname3(){
//assign var to value
var love3 = document.getElementById("password");
var sortname3 = love3.value.search(/[A-Z]0-9a-zA-Z{6, }\D\d\D/);
if(sortname3 != 0){
alert("message");
return false;
}
else
return true;
}
JAVASCRIPT:
You can also put /[A-Z][\da-zA-Z]{6}\d/ in the search function.
FOR ANY HELP JUST DROP A COMMENT
Password must begin with a capital letter followed by exactly 6 alphanumeric letters followed by a...