Gadgets

Monday, 29 December 2014

Conform Password with client side validation



Conform Password with client side validation

In this article I explained that, HTML Conform password with client side validation. Here in this form I taken password and conform password, here I taken password pattern, that password should be  a-z,A-Z,0-9 and password length is between 8 to 30 letters.




<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body>
<form action=""method="post">
<table align="center">
<tr><td>Password :</td><td><input type="password" name="psw"  pattern="[a-zA-Z0-9 ]{8,30}"tabindex="1"class="input-box"onchange="this.setCustomValidity(this.validity.patternMismatch ? 'Password contain at least 8 charecters':'');if(this.checkValidity())form.cpsw.pattern=this.value"required/></td></tr>
<tr><td>Conform Password :</td><td><input type="password" pattern="[a-zA-Z0-9 ]{8,30}"name="cpsw"  tabindex="2"class="input-box"onchange="this.setCustomValidity(this.validity.patternMismatch ? 'Please enter same password as above':'');"required/></td></tr>
<tr><td></td><td><input type="submit" value="SignUp" tabindex="3"/></td></tr>
</table>
</form>
</body>
</html>


HTML Login form with validation

Password :
Conform Password :

No comments:

Post a Comment