[Javascript] Form submission problem

TomMallard mallard at serv.net
Mon Aug 20 09:45:09 CDT 2001


Versions of NS don't honor using forms[0] if there's only one element.

Most browsers will have trouble with a forms submission from inline js if
the pages are in frames, layers or iframes...

<a href="javascript:document.generate.submit();">submit</a>

...to distinguish the call, use "this"...

<a href="javascript:this.document.generate.submit();">submit</a>

HTH,

tom mallard
seattle
----- Original Message -----
From: "Rees, Mark (TWIi London)" <mrees at twii.net>
To: <javascript at LaTech.edu>
Sent: Monday, August 20, 2001 7:15 AM
Subject: RE: [Javascript] Form submission problem


> Hello
>
> The first makes no difference - I have also tried
document.foms[0].submit()
> (and shouldn't it be document.forms('generate').submit() btw
>
> No there isn't. It's like I say, the submit button works fine and I can
> refer to and manipulate form elements via the DOM no problem
>
> Thanks
>
> mark
>
>
>
> -----Original Message-----
> From: Peter Brunone [mailto:peter at brunone.com]
> Sent: 20 August 2001 15:04
> To: javascript at LaTech.edu
> Subject: RE: [Javascript] Form submission problem
>
>
>
> Try referencing the forms collection as well, e.g.
> document.forms.generate.submit() .
>
> If that doesn't work, make sure there's no other object in your page
> named
> "generate".
>
> |-----Original Message-----
> |From: javascript-admin at LaTech.edu [mailto:javascript-admin at LaTech.edu]On
> |Behalf Of Rees, Mark (TWIi London)
> |Sent: Monday, August 20, 2001 6:14 AM
> |To: 'javascript at LaTech.edu'
> |Subject: [Javascript] Form submission problem
> |
> |
> |Hello
> |
> |I'm trying to submit a form using a text link rather than an image/submit
> |button. The form is called generate (not a reserved word as far as I can
> |see) so my syntax is like so:
> |
> |<a href="javascript:document.generate.submit();">submit</a>
> |
> |This gives me a line 1 char 1 Document does not support this property or
> |method error (in ie). In netscape I get document.generate.submit is not a
> |function. However the submit button right next to it works fine.
> |
> |I've used this syntax before on other forms - I'm totally
> |mystified. I would
> |post code but it's a bit massive.
> |
> |Any ideas?
> |
> |Thanks for any help you can provide
> |
> |Mark
> |_______________________________________________
> |Javascript mailing list
> |Javascript at LaTech.edu
> |http://www.LaTech.edu/mailman/listinfo/javascript
> |
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> http://www.LaTech.edu/mailman/listinfo/javascript
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> http://www.LaTech.edu/mailman/listinfo/javascript
>




More information about the Javascript mailing list