[thelist] submit form via javascript. fine in IE, broke in Netscape

Scott Brady evolt at scottbrady.net
Fri Oct 24 08:19:56 CDT 2003


Original Message:
> From: "Scott Blanchard" <octigonuser at hotmail.com>

> function x8doSave(){
> 	send_to_html(); // this preps the code reeeeeaaal nice
> 	document.getElementById('myform').submit(); // works in IE only
> }

> <form id="myform" name="wysiwygproForm" method="post" action="save.asp" 
> target="x8iframe" onSubmit="submit_form()">

For your .submit() line, try this:
document.forms['wysiwygproForm'].submit();

I believe that way the browsers will know it's a form object you're trying to use the submit() method on.  (I'd think it should still know, but it can't hurt.)

(also, for standards' sake, make your "onSubmit=..." attribute in your form tag be all lowercase (onsubmt=...)

Scott
----------------------------
Scott Brady
http://www.scottbrady.net/




More information about the thelist mailing list