I wanna validate an input of password
<form name="regist" action="proc/regist.php" onsubmit="return validate_form1()" method="post">
<p>Your Username: <input type="text" name="regist_name" /></p>
<p>Your Password: <input type="password" name="regist_password1"/> at least 6 characters</p>
<p>Repeat Password: <input type="password" name="regist_password2" /></p>
<input type="submit" value="Register NOW">
i tried to set the function like this :
function validate_form1(){
if(regist_password1.length<6){
alert("Your password is too short , please try again!");
return false;
}
}
maybe the problem is in "regist_password1.length" .