submit form data to a new window failed using HTTP POST

Discussion in 'ASP General' started by Matt, Aug 23, 2004.

  1. Matt

    Matt Guest

    The following program submit a FORM DATA to a new window using HTTP POST,
    and postprocess.asp couldn't get the form data. If I do in GET method and
    pass by
    query string in windowURL, then it works. But I need HTTP POST method, are
    there
    any workarounds?

    <html>
    <script type="text/javascript">
    function checkAndSubmitForm(theForm)
    {
    var windowURL = theForm.action;
    window.open(windowURL, "newWin",
    "scrollbars=0,menubar=0,toolbar=0,location=0,status=0");
    }
    </script>

    <body>
    <FORM NAME="formname" method="POST" action="postprocess.asp">
    <P><input type=text" name="username"/>
    <P><input type="button" name="submitBtn" value="Submit Form"
    onClick="checkAndSubmitForm(document.formname)">
    </FORM>
    </body>
    </html>

    postprocess.asp is just one line statement to get the form data
    <%= Request.Form() %>


    any ideas? please help!! thanks!!
     
    Matt, Aug 23, 2004
    #1
    1. Advertising

  2. Matt wrote:
    > The following program submit a FORM DATA to a new window using HTTP
    > POST, and postprocess.asp couldn't get the form data. If I do in GET
    > method and pass by
    > query string in windowURL, then it works. But I need HTTP POST
    > method, are there
    > any workarounds?


    No. Post the data from page A to page B in the same window. Page B processes
    the data and uses client-side code in the onload event to open a third page
    (C) in a new window, closing the original window if you don't want to have
    two windows open.

    Some popup stoppers will need to be configured to not interfere in this
    process

    An alternative would be to use XMLHTTP to post the data to page B,. and when
    you get the result, open the new window.

    You are not getting a lot of response to this question because:
    1. You asked it during the weekend
    2. It is off-topic. Only client-side code can be used to open a new window,
    and ASP is server-side technology

    Bob Barrows
    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
     
    Bob Barrows [MVP], Aug 23, 2004
    #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. Matt
    Replies:
    4
    Views:
    11,975
    vivekvsingh
    Sep 14, 2006
  2. Matt
    Replies:
    7
    Views:
    5,330
    Isofarro
    Aug 27, 2004
  3. Replies:
    2
    Views:
    6,248
  4. Matt
    Replies:
    1
    Views:
    223
  5. Replies:
    2
    Views:
    362
Loading...

Share This Page