Hi. I want to pass a parameter to a js function and then use that parameter as the reference form in a document.__.submit() statement in the function. The coding is below. The js function fires, but the form fails to be submitted by the js. I am probably missing something obvious here, but...? Thanks to anyone who can shed some light on this for me! <script language="JavaScript" type="text/javascript"> function openmydoc(theform) { document.theform.submit(); } </script> <form name="opendoc101" action="document.php" method="POST" id="101" > </form> <a href="javascript: openmydoc('opendoc101')">Do It</a>
haven't tested this but the parameter that you are passing to the document is a string so this should work: <script language="JavaScript" type="text/javascript"> function openmydoc(theform) { document.getElementById(theform).submit(); } </script> <form name="opendoc101" action="document.php" method="POST" id="101" > </form> <a href="javascript: openmydoc('opendoc101')">Do It</a> Code (markup):