By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,504 Members | 1,212 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,504 IT Pros & Developers. It's quick & easy.

querystring exceeds size limit using window.open

P: n/a
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,resizabl e=yes,status=yes,top=10,left=50');

}
</script>

May 16 '06 #1
Share this Question
Share on Google+
8 Replies


P: n/a
Ben wrote:
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,h eight=550...')">
--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
May 16 '06 #2

P: n/a

"Ben" <bc*******@yahoo.com> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.com...
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,resizabl e=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.

May 16 '06 #3

P: n/a
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.

May 16 '06 #4

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

May 16 '06 #5

P: n/a
[Please quote what you are responding to]

Ben wrote:
Thanks, but this page is being posted back to itself so there
are many different ways to submit.


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 and ensure that target
is opened. I don't care how you implemented it -- my example was meant to
illustrate the use of TARGET.

Besides -- "posted back to itself" is inconsistent with passing "a large
number
of ID's using window.open". Are you saying that each successive instance of
the script will opsn another copy of itself into yet another popup window?
--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
May 17 '06 #6

P: n/a

"Ben" <bc*******@yahoo.com> wrote in message
news:11**********************@y43g2000cwc.googlegr oups.com...
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.


May 17 '06 #7

P: n/a
Ben
Dave wrote:
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,he ight=550,scrollbars=yes,resizable=yes,status=yes,t op=10,left=50");
newWin.document.frmTemp.submit();
}

May 17 '06 #8

P: n/a
Ben wrote:
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...");

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
May 17 '06 #9

This discussion thread is closed

Replies have been disabled for this discussion.