Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jun 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Using parameter in document.__.submit()

    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>
    Last edited by peodes; 06-20-2009 at 06:58 PM.

  • #2
    New to the CF scene
    Join Date
    Jun 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Solved. The answer was

    document.getElementById(theform).submit();


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •