checking text field value length
<p>I am trying to see if the text field length is at least a certain length.  here is my code:</p>

<pre><code>&lt;form name="form2" id="form2" onsubmit="return validate()"&gt;
length 4: &lt;input type="text" name = "t" id="t" /&gt;
&lt;input type="button" name="submit" value="submit" /&gt;
&lt;/form&gt;

&lt;script&gt;
function validate() {
    document.write("good");
    submitFlag = true;
    if(document.form2.t.value.length!=4){
        submitFlag=false;
        alert("ivalid length - 4 characters needed!");
    }
    return submitFlag;
}
&lt;/script&gt;
</code></pre>

<p>when I click submit, nothing happens.</p>
