querystring exceeds size limit using window.open

B

Ben

Thanks in advance for any help. I am attempting to pass a large number
of ID's using window.open in javascript. The number of the ID's exceeds
the querystring length. Therefore, I would like to somehow use the POST
method to submit. (or another method without rewriting the ASP page!)
Please review the code below before submitting since this can be easily
done but I am not sure how using <body onload... >.

%>
<body onload="myFunc('<%=request("wid")%>')"></body>
<%

<script language=javascript>
function myFunc(w2)
{
var args = "&wono=" + w2;

window.open("test_alert.asp?"+args,
null,'width=600,height=550,scrollbars=yes,resizable=yes,status=yes,top=10,left=50');

}
</script>
 
D

Dave Anderson

Ben said:
Thanks in advance for any help. I am attempting to pass a large
number of ID's using window.open in javascript. The number of
the ID's exceeds the querystring length. Therefore, I would
like to somehow use the POST method to submit...

This is not really an ASP question, but...

<form method="post"
action="test_alert.asp"
target="windowName"
onsubmit="window.open('','windowName','width=600,height=550...')">
 
A

Anthony Jones

Ben said:
Thanks in advance for any help. I am attempting to pass a large number
of ID's using window.open in javascript. The number of the ID's exceeds
the querystring length. Therefore, I would like to somehow use the POST
method to submit. (or another method without rewriting the ASP page!)
Please review the code below before submitting since this can be easily
done but I am not sure how using <body onload... >.

%>
<body onload="myFunc('<%=request("wid")%>')"></body>
<%

<script language=javascript>
function myFunc(w2)
{
var args = "&wono=" + w2;

window.open("test_alert.asp?"+args,
null,'width=600,height=550,scrollbars=yes,resizable=yes,status=yes,top=10,le
ft=50');

}
</script>

Changing to POST method WILL require some changes to the page.

Since the data for the Test_alert.asp page is already on the server why not
store it somewhere and just send a tag for the data to the client.

The Test_alert can use the tag to retrieve the actual data.

Anthony.
 
B

Ben

Thanks, but this page is being posted back to itself so there are many
different ways to submit. You are right... more javascript than an ASP
post. Sorry about that.
 
B

Ben

I was trying to stay away from Session Variables but it looks like I
need to use them. Thanks.
 
A

Anthony Jones

Ben said:
I was trying to stay away from Session Variables but it looks like I
need to use them. Thanks.

A session variable is one way of doing it but not the only way. You could
use a table in an DB as an alternative.
 
B

Ben

Dave said:
I think you are missing the point. If you want to POST a form into a popup
window, use the TARGET attribute of the FORM element

Thanks Dave... I appreciate your help. Maybe I should be getting away
from <body onload...
Anyway, below is my lastest attempt... opens the new window but no data
submitted to new window. Can you see the problem?

<form name="frmTemp" action="wor_alert.asp" method="POST"
target="newWin">
<input type="hidden" name="wono"
value="<%=request("wono")%>">
</form>

<body onload="myFunc1();"></body>

function myFunc1() {
var newWin =
window.open("wor_alert.asp","newWin","width=600,height=550,scrollbars=yes,resizable=yes,status=yes,top=10,left=50");
newWin.document.frmTemp.submit();
}
 
D

Dave Anderson

Ben said:
Anyway, below is my lastest attempt... opens the new window
but no data submitted to new window. Can you see the problem?
Yes:
window.open("wor_alert.asp","newWin","width=600...");

That should be:
window.open("","newWin","width=600...");
 

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,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top