I have a php page which contains a form, within that same page I have JavaScript to validate input in the form fields, on the form I have
<FORM name="the_form" method="POST" onsubmit="validate();" action="val_checkout.php">
so when the form is submited the javascript checks for errors, if one is found I use the javascript alert() to show a pop up window but when the ok button of that pop up window is pressed the val_checkout.php
is called.
How can I avoid been redirected if an error is found?
Thanks fellas!