Hi all –
I am having a problem with the onsubmit event handler. Onsubmit, I call the function below. The problems I am having are:
1) If the confirm dialog is used, the redirect does not occur – the form processes as normal.
2) If the alert dialog is used, even though the function returns false after the dialog, the form still submits! I have been wrestling with this for a while now.
Thanks for your help.
[code]
function enterInfo() {
if (validate() == 1) {
if (confirm(“Would you like to enter our monthly prize drawing? (OK = Yes, Cancel = No)”)) {
window.location = “enter_info.php”;
return true;
}
else {
window.location = “thank_you.php”;
return true;
}
}
else if (validate() == -1) {
alert(‘Please respond to all questions.’);
return false;
}
}