Gadgets

Showing posts with label validation. Show all posts
Showing posts with label validation. Show all posts

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 :

HTML Login form with validation



HTML Login form with validation
In this article I explained that, HTML Login form with client side validation. Here in this form I taken email id and password, in this form we should give the correct email id pattern otherwise it will not take wrong email id pattern and 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>Email id :</td><td><input type="email"name="eid" pattern="^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+[a-zA-Z]{2,6}$" tabindex="1"required /></td></tr>
<tr><td>Password :</td><td><input type="password"name="psw" tabindex="2" pattern="[a-zA-Z0-9 ]{8,30}"required/></td></tr>
<tr><td></td><td><input type="submit" value="SignIn"tabindex="3"/></td></tr>
</table>
</form>
</body>
</html>
Email id :
Password :