This redirects to new page specified always the form is submitted either by validation is confirmed or without. I want it to be redirected after it is confirmed. Help me out with this
<form name="studentDetails" onsubmit="validate()" method="POST" action="successRegistration.html">
<table>
<tr>
<td><label for="name">Student Name:</label></td>
<td><input type="text" id="name"/></td>
</tr>
<tr>
<td><label for="password">Student Password:</label></td>
<td><input type="password" id="password"/></td>
</tr>
<tr>
<td><label for="age">Student Age:</label></td>
<td><input type="text" id="age" minlength="2" maxlength="2"/></td>
</tr>
<tr>
<td><label for="gender">Gender:</label></td>
<td><input type="radio" name="gender" id="gender" value="M"/>Male</td>
<td><input type="radio" name="gender" id="gender" value="F"/>Female</td>
</tr>
</table><br/>
<input type="submit" value="Register"/>
</form>