RobG wrote:
Martin Honnen wrote: Martin wrote: In the "validate" function I have "return false" in the script (if the
validation fails) but the form submits any way. How can I get this
thing to not submit on a failed validation?
<input type="submit" name="Save" value="Save"
onclick="return validate(this.form);">
then let the validate function return true or false depending on whether
the submission should be done or cancelled.
And if the form is submitted using the enter key (i.e. without clicking
on either button), what should happen then?
Full ACK. I wished Martin would stop proposing this unreliable approach for
he definitely should know better, also considering that we have discussed
this ad nauseam here now, and reliable alternatives with `onsubmit' were
presented.
PointedEars
--
A man who works with his hands is a laborer; a man who works with his
hands and his brain is a craftsman; but a man who works with his hands
and his brain and his heart is an artist.
-- Louis Nizer, lawyer (1902-1994)