Submit a form in FireFox ...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • christianboivin1@hotmail.com

    Submit a form in FireFox ...

    Hi,

    Maybe someone know why this code does not work ...

    <html>
    <form name='frmData' action='http://www.adrX.ca/usr_auth.asp'
    method='POST'>

    <input type='hidden' name='USER_ID' value='12345'>

    <input type='hidden' name='lang' value='FR'>

    <input type='hidden' name='TOKEN' value='555555'>
    <script type="text/javascript">
    document.frmDat a.submit();
    </script>
    </form>
    </html>

    Thanks
    Chris

  • Lee

    #2
    Re: Submit a form in FireFox ...

    christianboivin 1@hotmail.com said:[color=blue]
    >
    >Hi,
    >
    >Maybe someone know why this code does not work ...
    >
    ><html>
    ><form name='frmData' action='http://www.adrX.ca/usr_auth.asp'
    >method='POST '>
    >
    > <input type='hidden' name='USER_ID' value='12345'>
    >
    > <input type='hidden' name='lang' value='FR'>
    >
    ><input type='hidden' name='TOKEN' value='555555'>
    ><script type="text/javascript">
    > document.frmDat a.submit();
    ></script>
    ></form>
    ></html>[/color]

    By putting the Javascript code before the closing </form> tag,
    you're asking the browser to submit a form that doesn't exist, yet.

    <html>
    <body onload="documen t.frmData.submi t()">
    <form name="frmData" ...>
    ....
    </form>
    </body>
    </html>

    Comment

    • ASM

      #3
      Re: Submit a form in FireFox ...

      christianboivin 1@hotmail.com wrote:[color=blue]
      > Hi,
      >
      > Maybe someone know why this code does not work ...[/color]

      no, but :
      onload= Function("docum ent.forms['frmData'].submit()");
      or
      setTimeout('doc ument.frmData.s ubmit()',0);
      both work
      [color=blue]
      >
      > <html>
      > <form name='frmData' action='http://www.adrX.ca/usr_auth.asp'
      > method='POST'>
      >
      > <input type='hidden' name='USER_ID' value='12345'>
      >
      > <input type='hidden' name='lang' value='FR'>
      >
      > <input type='hidden' name='TOKEN' value='555555'>
      > <script type="text/javascript">
      > document.frmDat a.submit();
      > </script>
      > </form>
      > </html>
      >
      > Thanks
      > Chris
      >[/color]


      --
      Stephane Moriaux et son [moins] vieux Mac

      Comment

      • Tim Slattery

        #4
        Re: Submit a form in FireFox ...

        christianboivin 1@hotmail.com wrote:
        [color=blue]
        >Hi,
        >
        >Maybe someone know why this code does not work ...
        >
        ><html>
        ><form name='frmData' action='http://www.adrX.ca/usr_auth.asp'
        >method='POST '>
        >
        > <input type='hidden' name='USER_ID' value='12345'>
        >
        > <input type='hidden' name='lang' value='FR'>
        >
        ><input type='hidden' name='TOKEN' value='555555'>
        ><script type="text/javascript">
        > document.frmDat a.submit();
        ></script>
        ></form>
        ></html>[/color]

        Only a guess, but I'd move the script block to after the </form>
        element. I'm guessing that the form is not completed when the script
        tries to run.

        Have you looked at the Javascript console in Firefox? That's usually
        very helpful.

        --
        Tim Slattery
        Slattery_T@bls. gov

        Comment

        • ASM

          #5
          Re: Submit a form in FireFox ...

          Tim Slattery wrote:[color=blue]
          > christianboivin 1@hotmail.com wrote:
          >
          >[color=green]
          >>Hi,
          >>
          >>Maybe someone know why this code does not work ...
          >>
          >><html>
          >><form name='frmData' action='http://www.adrX.ca/usr_auth.asp'
          >>method='POST' >
          >>
          >> <input type='hidden' name='USER_ID' value='12345'>
          >>
          >> <input type='hidden' name='lang' value='FR'>
          >>
          >><input type='hidden' name='TOKEN' value='555555'>
          >><script type="text/javascript">
          >>document.frmD ata.submit();
          >></script>
          >></form>
          >></html>[/color]
          >
          >
          > Only a guess, but I'd move the script block to after the </form>
          > element.[/color]

          Tried that and ... no more :-(
          [color=blue]
          > Have you looked at the Javascript console in Firefox? That's usually
          > very helpful.[/color]

          not really an help :
          "the form has no properties"

          I think FF wait end of page
          an onload
          or a setTimeout (timer=0)
          are OK




          --
          Stephane Moriaux et son [moins] vieux Mac

          Comment

          • Chris

            #6
            Re: Submit a form in FireFox ...

            Thanks to you all,

            I found, with putting a function called on the body.onload event

            Chris

            Comment

            Working...