This function checks dates for validitity, with return if all dates are correct:
[code]
function doDateCheck(from, to) {
if (Date.parse(from.value) <= Date.parse(to.value)) {
return;
}
else {
if (from.value == “” || to.value == “”)
alert(“Both dates must be entered.”);
else
alert(“To date must occur after the from date.”);
}
}
In the related form, the submit button is configured like so:
[code]
<input type=”Submit” name=”Submit” onClick=”doDateCheck(this.form.from, this.form.to);” value=”Send”>
When I attempt to submit the form with invalid dates, this picks up the failures, but when the OK button of the alert box is clicked, the form then posts as if the values had been correct.
I want the precess to stop until the input dates have been corrected to an acceptable value, and the submit button is re-pressed. How to I go about that?