Home All Groups Group Topic Archive Search About

querystring exceeds size limit using window.open



Author
16 May 2006 9:17 PM
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>

Author
16 May 2006 9:30 PM
Dave Anderson
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,height=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.
Author
16 May 2006 9:40 PM
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.
Author
17 May 2006 7:09 AM
Dave Anderson
[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.
Author
17 May 2006 4:34 PM
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,height=550,scrollbars=yes,resizable=yes,status=yes,top=10,left=50");
        newWin.document.frmTemp.submit();
}
Author
17 May 2006 5:18 PM
Dave Anderson
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.
Author
16 May 2006 9:33 PM
Anthony Jones
Show quote
"Ben" <bcummi***@yahoo.com> wrote in message
news:1147814230.894027.290470@i40g2000cwc.googlegroups.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,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.
Author
16 May 2006 9:43 PM
Ben
I was trying to stay away from Session Variables but it looks like I
need to use them.  Thanks.
Author
17 May 2006 8:33 AM
Anthony Jones
"Ben" <bcummi***@yahoo.com> wrote in message
news:1147815786.681546.117260@y43g2000cwc.googlegroups.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.

AddThis Social Bookmark Button