windwo.open querystring parameters

S

Stephen Witter

I have asp1 that posts to asp2 which uses request.form to get info
from asp1. How can I get the window.open function to process form
asp1's posted inputs? What I am trying to do is allow the user the
choice of viewing an asp in a frame, or in a full window. Either way,
I want it to open asp2 and have the request.form get the info. This
doesn't work for me using window.open, I assume, because form asp1
isn't being submitted, and it's action (which is the URL of asp2)
isn't used.

Any help is appreciated.
 
B

Bob Barrows

Stephen said:
I have asp1 that posts to asp2 which uses request.form to get info
from asp1. How can I get the window.open function to process form
asp1's posted inputs? What I am trying to do is allow the user the
choice of viewing an asp in a frame, or in a full window. Either way,
I want it to open asp2 and have the request.form get the info. This
doesn't work for me using window.open, I assume, because form asp1
isn't being submitted, and it's action (which is the URL of asp2)
isn't used.

Any help is appreciated.

You can response.write information from server-side code into client-side
code. like this:


sub window_open
dim str
str="<%=request.form("somevariable")%>

Now the client-side code can do whatever it wants with the value contained
in the str variable.

HTH,
Bob Barrows
 
N

news.microsoft.com

hi,
you can use too in the onunload event of opened window(javascript):
window.opener.frmX.txtX.value = VarX;

bye
vilmar
 
S

Stephen Witter

In case anyone is interested, here is how I did it:

In the asp2 page I put the following:
<%
'in the event a user has selected a full view
'get the posted values
for each item in request.form
response.write("<input type=hidden name=""" & item & """ value="""
& request.form(item) & """>" & vbcrlf)
next
%>

This dynamically adds the input items (hidden) to the newly opened
window

in asp1 I used:

<script LANGUAGE="JavaScript">
function clickGo() {
document.frmParam.action = "<%=Reportpath%>";
WinWidth=screen.width-10
WinHeight=screen.height-90
winOpts="toolbars=no,status=yes,width=" + WinWidth + ",height=" +
WinHeight + ",top=0,left=0,maximize=yes,location=no,directories=no,scrollbars=yes";
window.open('','FullView',winOpts);
document.frmParam.target = 'FullView';
document.frmParam.submit();
}
</script>

I have a submit button that calls the clickGo function

my form tag:

<form name="frmParam" method="POST" action="<%=Reportpath%>">

the <%=Reportpath%> is a vbscript variable that gets the report path
from a database
 

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

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,037
Latest member
MozzGuardBugs

Latest Threads

Top