submit form data to a new window failed using HTTP POST

M

Matt

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!!
 
B

Bob Barrows [MVP]

Matt said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,781
Messages
2,569,619
Members
45,314
Latest member
HugoKeogh

Latest Threads

Top