Javascript function to validate password
<p>I wanna validate an input of password </p>

<pre><code>&lt;form name="regist" action="proc/regist.php" onsubmit="return validate_form1()" method="post"&gt;
&lt;p&gt;Your Username:   &lt;input type="text" name="regist_name" /&gt;&lt;/p&gt;
&lt;p&gt;Your Password:   &lt;input type="password" name="regist_password1"/&gt; at least 6 characters&lt;/p&gt;
&lt;p&gt;Repeat Password: &lt;input type="password" name="regist_password2" /&gt;&lt;/p&gt;
&lt;input type="submit" value="Register NOW"&gt; 
</code></pre>

<p>i tried to set the function like this : </p>

<pre><code>function validate_form1(){
    if(regist_password1.length&lt;6){
        alert("Your password is too short , please try again!");
        return false;
    }
}
</code></pre>

<p>maybe the problem is in "regist_password1.length" .</p>
