Thank you for coming back on this.
So, as I understand it, if the function is re-written like this:
Code:
function doDateCheck(from, to) {
if (Date.parse(from.value) <= Date.parse(to.value)) {
return true;
}
else {
if (from.value == "" || to.value == "")
alert("Both dates must be entered.");
return false;
else
alert("To date must occur after the from date.");
return false;
}
}
and the form is coded:
Code:
<form action="feedback.php" method="post" onSubmit="return doDateCheck(this.form.from, this.form.to)">
<pre>
From date <input type=text name=from onBlur="checkdate(this)" size=11 maxlength=11>
To date <input type=text name=to onBlur="checkdate(this)" size=11 maxlength=11>
<input type="Submit" name="Submit" value="Send">
</pre>
</form>
All should now be well. Unfortunately, entering a false date is now ignored - so clearly I am missing a trick. I'd be grateful for a further steer on this.
Bookmarks