Problems with Form.Submit in validation routine
Quote:
> [Apologies for attachments]
> I have two javascript routines for submitting forms:
> SubmitSN(oForm, sAction) - sets action for oForm then submits form without
> validating
> Validate(oForm, sAction) - sets action for form, validates nominated
> fields on form, if no validation error then it submits form
> SubmitSN:
> function SubmitSN(oForm, sAction)
> {
> oForm.action = sAction;
> oForm.submit();
> }
> Validate: I havent submitted a snippet, since the file is rather large
> (10k)
> On certain forms, these functions work, on others (typically, the more
> complex ones) they don't; from what I have gathered, they both fall over
> at the 'oForm.submit();' lines - "Object doesnt support this property or
> method"
> As you can see, the SubmitSN function is very simple... what is more it
> works on some pages but for some reason not others.
> EditSerial.asp and NewSerial.asp (attached) are very similar in function
> and structure (in fact, one was originally created from the other),
> however, for whatever reasons, the scripts work on NewSerial but not on
> EditSerial...
> Please can somebody help before my head explodes!
EditSerial.asp contains a control:
<input id="Update" type="button" name="submit" ...>
Never, ever give a form control the same name as one of the form's methods.
BTW, both your pages have invalidly nested markup:
<form>
<table>
</form>
</table>
--
Holding on to anger is like grasping a hot coal with the intent of
throwing it at someone else; you are the one getting burned. -Buddha
=-=-=
Steve
-=-=-