|
Do not use onclick on the submit button. Leave it as it is (if a submit) and let the function to be fired from FORM tag by the event handler OnSubmit. Give a return condition here and specify the return true/false in the validate function.
<script>
function validate(){
if (true condition here){
return true;
}
else {
return false;
}
}
<script>
.
.
.
<body>
<form onsubmit = "return validate()">
.
.
.
<input type="submit">
</form>
</body>
Or use the false condition to return false, whatever....
|