I am doing client side validation to my registration page in html by using jquery. After submitted the form without giving text entries, I am getting the alert box with proper info what I have given in jquery function. But the problem is after click on "OK" button on alert box, the form is going to submit to action page directly. Can any one please help on it. Thanks, Swami.
<script>
function Submit(){
var fname = $("#fname").val();
if($("#fname").val() == "" ){
alert("please enter firsname")
return false;
};
};
</script>
<form method="post" action="#">
//fields here
<input type="button" value="Register" onclick="Submit();">
</form>