Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > submit form data to a new window failed using HTTP POST

Reply
Thread Tools

submit form data to a new window failed using HTTP POST

 
 
Matt
Guest
Posts: n/a
 
      08-23-2004
The following program submit a FORM DATA to a new window using HTTP
POST,
and postprocess.jsp 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,
and I cannot use target="_blank" because I need to control the new
window's
properties (disable the scrollbars, menubars, etc...)

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,statu s=0");
}
</script>

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

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


any ideas? please help!! thanks!!
 
Reply With Quote
 
 
 
 
VK
Guest
Posts: n/a
 
      08-23-2004
var w = window.open("bogus.html", "newWin", ...);
theForm.target = "newWin";
theForm.submit();

where bogus.html is an empty placeholder. may use "about:blank" instead
which is more elegant but doesn't go smoothly with all browsers.

good luck!



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
submit form data to a new window failed using HTTP POST Matt Java 4 09-14-2006 04:13 PM
submit the form data to the popup window without a submit button jrefactors@hotmail.com Javascript 2 01-01-2005 06:07 AM
submit the form data to the popup window without a submit button jrefactors@hotmail.com HTML 2 01-01-2005 06:07 AM
submit form data to a new window failed using HTTP POST Matt HTML 7 08-27-2004 09:53 PM
submit form data to a new window failed using HTTP POST Matt ASP General 1 08-23-2004 10:48 AM



Advertisments