javascript poput that passes data

  • Thread starter Øyvind Isaksen
  • Start date
Ø

Øyvind Isaksen

Hi!

I have an ASP page and with a form, and when the a user clicks the
submit-buttom the form shall be posted using a popup-script and
method="get".
The problem is that when I use a "normal" popup javascript, the formfields
dont get posted.

In file2.asp I want the url to be file2.asp?hidden1=value1 (but I only get
file2.asp without the formfield hidden1)
I tried to find a newsgroup with html or javascript, but without success.
Hope someone can help me with a javascript that passes data....


Thanks!!!


This is my script:

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "',
'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=4
00,height=600,left = 476,top = 57');");
}
// End -->
</script>



<form method ="get">
<input type="hidden" value="value1" name="hidden1">
<input type=submit value="Open the Popup Window"
onClick="javascript:popUp('file2.html')">
</form>
 
E

Evertjan.

Øyvind Isaksen wrote on 04 apr 2004 in
microsoft.public.inetserver.asp.general:
I have an ASP page and with a form, and when the a user clicks the
submit-buttom the form shall be posted using a popup-script and
method="get".
The problem is that when I use a "normal" popup javascript, the
formfields dont get posted.

In file2.asp I want the url to be file2.asp?hidden1=value1 (but I only
get file2.asp without the formfield hidden1)
I tried to find a newsgroup with html or javascript, but without
success. Hope someone can help me with a javascript that passes
data....

This is my script:

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "',
'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,wi
dth=4 00,height=600,left = 476,top = 57');");
}
// End -->
</script>

<form method ="get">
<input type="hidden" value="value1" name="hidden1">
<input type=submit value="Open the Popup Window"
onClick="javascript:popUp('file2.html')">
</form>

This has nothing to do with serverside ASP.

Please ask a javascript NG.

[ btw: eval is evil ]
 
M

Matt Foster

Try this:

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "',
'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=4
00,height=600,left = 476,top = 57');");
}
// End -->
</script>



<form method ="get" action="javascript:popUp('file2.html')">
<input type="hidden" value="value1" name="hidden1">
<input type=submit value="Open the Popup Window">
</form>
 

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

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,585
Members
45,081
Latest member
AnyaMerry

Latest Threads

Top