Posting form

Discussion in 'ASP General' started by Allwyn, Aug 25, 2003.

  1. Allwyn

    Allwyn Guest

    The code below doesn't work. Any help would be
    appreciated. I need to force the form to submit via post
    method, rather than response.redirect("Page2.asp?.....")
    which doesn't post the form.

    Page1 has form called "frm"

    Page1 has a href link, like this, <a href="Page1.asp?
    tab=aa">click here</a>

    When it reloads Page1, after clicking link,

    Select Case tabid
    case "aa"
    ViewDetail
    ---other case statements--
    End Select


    Sub ViewDetail
    <SCRIPT LANGUAGE=vbs>
    frm.action = "Page2.asp?tabid=ccc&Act=200"
    frm.submit
    </SCRIPT>
    End Sub
     
    Allwyn, Aug 25, 2003
    #1
    1. Advertising

  2. Allwyn

    KLomax Guest

    See if this code helps...
    Regards

    <HTML>
    <body>
    <form id="frmThis" name="frmThis">
    <INPUT id="cmdPost" onclick="javascript:CallPage
    ('Test2.asp')" type="button" value="Post Page">

    <SCRIPT LANGUAGE="javascript">
    //<!--
    function CallPage(pageName){
    alert(pageName);
    document.frmThis.method = "post" ;
    document.frmThis.action = pageName ;
    document.frmThis.submit() ;
    }
    //-->
    </SCRIPT>

    </form>
    </body>
    </HTML>

    >-----Original Message-----
    >The code below doesn't work. Any help would be
    >appreciated. I need to force the form to submit via post
    >method, rather than response.redirect("Page2.asp?.....")
    >which doesn't post the form.
    >
    >Page1 has form called "frm"
    >
    >Page1 has a href link, like this, <a href="Page1.asp?
    >tab=aa">click here</a>
    >
    >When it reloads Page1, after clicking link,
    >
    >Select Case tabid
    > case "aa"
    > ViewDetail
    > ---other case statements--
    >End Select
    >
    >
    >Sub ViewDetail
    > <SCRIPT LANGUAGE=vbs>
    > frm.action = "Page2.asp?tabid=ccc&Act=200"
    > frm.submit
    > </SCRIPT>
    >End Sub
    >
    >.
    >
     
    KLomax, Aug 25, 2003
    #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. Jeff Baker

    WebClient form Posting with form name?

    Jeff Baker, Aug 28, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    763
    John Saunders
    Aug 29, 2003
  2. alanb
    Replies:
    2
    Views:
    547
    alanb
    Apr 23, 2004
  3. Rob Meade
    Replies:
    0
    Views:
    431
    Rob Meade
    Dec 1, 2004
  4. AmitKu
    Replies:
    7
    Views:
    531
    John Timney \(MVP\)
    Jan 8, 2007
  5. Replies:
    3
    Views:
    664
Loading...

Share This Page