JavaScript Auto Submit Form, Why Firefox!? Why!?

Associate
Joined
7 Oct 2003
Posts
674
Location
Bournemouth
Hi guys,

I have written an application in ASP, options are returned from a database; if there are multiple options you need to select a radio and continue.

if there is only one option, the form should be auto submitted. the form ID is 'autoform' for this example

Code:
<SCRIPT>autoform.submit();</SCRIPT>
Works in IE7, IE8, Chrome and Opera. But not firefox.

Any idea why its not happy? or what i can use. any ideas appreciated.
 
After a good hour, ive finally found this out. how annoying....

Code:
document.autoform.submit();
where "autoform" is the same as the form's "name" attribute.

OR

Code:
document.getElementById('autoform').submit();
where "autoform" is the same as the form's "id" attribute.


so remember if you are using NAME or ID to define your forms/HTML in general... Firefox requires different syntax either way.

man, that sucks!
 
Back
Top Bottom