Submit button is not working after using javascript
<p>I created a login page that has a login form which submits username and password to loginproc.php in order to check their validity and everything was working perfectly. Anyway, on the login page I wrote a JavaScript function that alert the user in case the username and password fields are empty. After I've done that, the JavaScript works fine but when i click the submit button nothing happens absolutely!</p>

<p>----------------------------------------This is the JavaScript----------------------</p>

<pre><code>&lt;script type='text/javascript'&gt;

function formValidator(){
    // Make quick references to our fields
    var username = document.getElementById('username');
    var password = document.getElementById('password');


    // Check each input in the order that it appears in the form!
    if(notEmpty(username, "The username field is empty!")){
        if(notEmpty(password, "The password is empty!")){

        }
    }

    return false;

}

function notEmpty(elem, helperMsg){
    if(elem.value.length == 0){
        alert(helperMsg);
        elem.focus(); // set the focus to this input
        return false;
    }
    return true;
}
&lt;/script&gt;
</code></pre>

<p>----------------------------------------This is the form----------------------</p>

<pre><code>&lt;form method="post" action="loginproc.php" onsubmit="return formValidator()" &gt;


&lt;tr&gt;&lt;td colspan="3"&gt;&lt;img src="icons/login.jpg" alt="Edugate" width="366" height="123"&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan="3" nowrap bgcolor="#990033" class="infoTitle"&gt;&lt;div align="center"&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan="3" nowrap class="infoTitle"&gt;&lt;div align="left"&gt;user login &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan="3" nowrap bgcolor="#990033" class="infoTitle"&gt;&lt;div align="center"&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td width="58"&gt;Username&lt;/td&gt;
&lt;td width="4"&gt;:&lt;/td&gt;
&lt;td width="297"&gt;&lt;input type="text" id="username" name="username" size="20"&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Password&lt;/td&gt;&lt;td&gt;:&lt;/td&gt;&lt;td&gt;&lt;input type="password" id="password" name="password" size="20"&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;&lt;input type="submit" class="BtnInTable" value="Login"&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;?php if ($error == 1)
print "&lt;tr&gt;&lt;td colspan='3' class='ppos'&gt;&lt;img src='icons/error.png' alt='error'&gt; Icorrect usename or password...&lt;/td&gt;&lt;/tr&gt;";?&gt;
&lt;tr&gt;&lt;td colspan="3" nowrap bgcolor="#990033" class="infoTitle"&gt;&lt;div align="center"&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/form&gt;
</code></pre>

<hr>

<p>Kindly, can anybody guide me. Thanks in advace</p>
