java script is not working in mozila
<p>I have added some javascript in html page for input validation.same page is working correct in IE and chrome but in <strong>mozila</strong> its not working.The problem is when user inputs invalid data its supposed to show <strong>alert msg box</strong> and when user clicks <strong>OK</strong> it should return <strong>false</strong> to form...<strong>BUT</strong> mozila is not waiting for <strong>alert box</strong> it just shows alert box for 5-6 sec and then goes to next page defined in <strong>form action="nextpage.php"</strong>  </p>

<pre><code> function validate_form(thisform) 
    {
    with (thisform) 
        {
        if (validate_required(oldpassword, "&lt;b&gt;Error: &lt;/b&gt;Please enter the Old Password!") == false)
        { changeColor("oldpassword"); return false; }

        else if (valid_length(newpassword, "&lt;b&gt;Error: &lt;/b&gt;Please enter the New Password!!") == false)
        {newpassword.value=""; changeColor("newpassword"); return false; }

        else if (valid_length(cnfpassword, "&lt;b&gt;Error: &lt;/b&gt;Please enter the Confirm Password!!") == false)
        {cnfpassword.value=""; changeColor("cnfpassword"); return false; }

        else if (document.getElementById('newpassword').value != document.getElementById('cnfpassword').value)
        {changeColor("newpassword");cool.error("&lt;b&gt;Error: &lt;/b&gt;Passwords entered are not same!"); 
        newpassword.value="";cnfpassword.value="";return false;}

    }
}function validate_required(field, alerttxt) 
    {
    with (field) 
        {
        if (value == null || value == "") 
            {
           cool.error(alerttxt);return false;
            }
        else 
            {
            return true;
            }
        }
    }
</code></pre>

<p><strong>cool.error</strong> is nothing but CSS nd Js for alert box.I thing there is not any problem in my <strong>code</strong> weather problem is in some browser settings.Is it so??? because it is working fine in <strong>IE</strong> and <strong>Chrome</strong>.</p>
