Hi;
I've seen lots of discussion & disagreement on this issue, so any good explanation would be appreciated.
Some people seem to think that "document.GetElementByID("MyName").submit(); should and does work. I and others have experienced that it should & doesn't work. I'll give you a little file that I tested with IE 6, FF 3, Opera & Chrome. Only the form button, document.myname.submit(); and document.forms['MyName'].submit(); worked. Take a look & let me know if I've done something wrong, or if there is a good reason that shouldn't work.
Thanks,
Chris
----- Code -----
[HTML]<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link type="text/css" rel="stylesheet" href="MyStyleSheet.css"/>
<title>TestJS</title>
</head>
<script language = JavaScript>
document.write("Hello World")
</script>
<body>
<FORM id="myform" name="myform" ACTION="tst.php">
<INPUT TYPE="SUBMIT" VALUE="Click for a Message Box" onclick="alert ('Button Pressed');">
<div onclick="javascript:alert('Hello!');document.myfor m.submit();"> Click Me! </div>
<div onclick="javascript:alert('Goodby!');document.GetE lementByID('myform').submit();"> <br/><br/><b>No, Me!</b><br/><br/> </div>
<div onclick="javascript:alert('It is sunny today.');document.forms['myform'].submit();"> <br/><br/><b>I say, Me!</b><br/><br/> </div>
</FORM>
</body>
</html>[/HTML]