Auto Form Submit

Discussion in 'ASP .Net' started by mazdotnet, May 17, 2006.

  1. mazdotnet

    mazdotnet Guest

    Hi guys,

    I have the following

    <form name="formpurchase" id="formpurchase"
    method=postaction="https://site.cgi">
    <input type=hidden name="MerchantNumber" value="<%=MerchantNumber
    %>">
    <input type=hidden name="ReturnURL" value="<%=retURL %>">
    <input type=hidden name="Products" value="<%=Products %>">

    <input type=submit value="Continue" name="submit">
    </form>

    How do I make it so that submission is done automatically? (without
    pressing the button)

    I've added this but it says 'object doesn't support this property'
    <script language="javascript">
    <!--
    if(document.all){
    frm=document.all.formpurchase
    }
    if(document.getElementById){
    frm=document.getElementById("formpurchase")
    }
    if (frm) frm.submit();
    -->
    </script>


    Thanks
    MA
    mazdotnet, May 17, 2006
    #1
    1. Advertising

  2. where did you place your script? it must come after the </form>, or better
    yet, hook its firing to the onload event.

    -- bruce (sqlwork.com)

    "mazdotnet" <> wrote in message
    news:...
    > Hi guys,
    >
    > I have the following
    >
    > <form name="formpurchase" id="formpurchase"
    > method=postaction="https://site.cgi">
    > <input type=hidden name="MerchantNumber" value="<%=MerchantNumber
    > %>">
    > <input type=hidden name="ReturnURL" value="<%=retURL %>">
    > <input type=hidden name="Products" value="<%=Products %>">
    >
    > <input type=submit value="Continue" name="submit">
    > </form>
    >
    > How do I make it so that submission is done automatically? (without
    > pressing the button)
    >
    > I've added this but it says 'object doesn't support this property'
    > <script language="javascript">
    > <!--
    > if(document.all){
    > frm=document.all.formpurchase
    > }
    > if(document.getElementById){
    > frm=document.getElementById("formpurchase")
    > }
    > if (frm) frm.submit();
    > -->
    > </script>
    >
    >
    > Thanks
    > MA
    >
    bruce barker \(sqlwork.com\), May 17, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. davout
    Replies:
    2
    Views:
    2,080
    davout
    Dec 7, 2004
  2. ppcguy

    auto form submit on ENTER key

    ppcguy, Aug 6, 2005, in forum: HTML
    Replies:
    4
    Views:
    7,645
    Benjamin Niemann
    Aug 8, 2005
  3. linkswanted
    Replies:
    1
    Views:
    901
  4. charlieLWallace
    Replies:
    1
    Views:
    136
    [MSFT]
    Oct 7, 2004
  5. Replies:
    3
    Views:
    666
Loading...

Share This Page