JavaScript Password Validation

Prev Tutorial Next Tutorial

JavaScript Password Validation

Here i will show you how to validate any password field like password field can not be blank and length of password is minimum 8 character.


function pass_validation()
var password=document.myform.password.value;  
if (password==null || password=="")
  alert("password can't be blank");  
  return false;  
else if(password.length<8)
  alert("Password must be at least 8 characters long.");  
  return false;  

<form name="myform" method="post" action="register.php" onsubmit="return pass_validation()" >  
Password: <input type="password" name="password">  
<input type="submit" value="submit">  



Prev Tutorial Next Tutorial

Google Advertisements
Download Projects

Google Adsense Advertisements

Buy 3 Year Old Domain,, @$200

Buy This Ad Space @$50 per Month, Ad Size 300X250 Contact on: WhatsApp no. 8882538826

Yahoo Advertisements