...

View Full Version : Using parameter in document.__.submit()



peodes
06-20-2009, 05:44 PM
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>

peodes
06-20-2009, 11:41 PM
Solved. The answer was

document.getElementById(theform).submit();



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum