I am using the following function to check for a required field:
Code:
function verify() {
var themessage = "You are required to complete the following fields: ";
if (document.order.tandc.value=="") {
themessage = themessage + " - Terms & Conditions";
}
//alert if fields are empty and cancel form submit
if (themessage == "You are required to complete the following fields: ") {
document.order.action=insertstandard.php;
}
else {
alert(themessage);
return false;
}
}
The code is checking for the required field, and displays the alert box however when the user clicks ok, the form is still processed!
Bookmarks