Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Open a popup on SOME submit buttons

13 views
Skip to first unread message

Marshall Dudley

unread,
Aug 30, 2004, 1:58:07 PM8/30/04
to
I have a page where there are multiple submit buttons, some load the
next page in the same window to continue, and some need to open the page
in a popup for additional information. Therefore I cannot put the
onSubmit in the form tag, or it will cause them all to open in the
popup.

I tried putting the onSubmit into the submit tag, and that did pop up
the next page in a popup window, but none of the other input variables
are being passed to the page, so it displays an error instead of the
correct information.

Does anyone know how to do this?

Thanks,

Marshall

Bart Van der Donck

unread,
Sep 2, 2004, 5:29:21 AM9/2/04
to
Marshall Dudley wrote:

I found this code that may be useful for you:
http://www.sitepoint.com/forums/showthread.php?t=51550

The idea is to read out your form elements and put them into
MYSCRIPT.CGI?var1=a&var2=b. It works only with a GET-request:

<html>
<head>
<script language="javascript">
function submitFunction(i) {
if (i==1) {
document.theForm.target = "";
document.theForm.action = "MYSCRIPT.CGI?var1=a&var2=b";
}
if (i==2) {
document.theForm.target = "pWindow";
document.theForm.action = "MYSCRIPT.CGI?var1=a&var2=b";
window.open('','pWindow','width=500,height=400');
}
document.theForm.submit()
}
</script>
</head>
<body>
<form name="theForm">
<input type="button" value="Submit to _self"
onClick="submitFunction(1)">
<input type="button" value="Submit to popup"
onClick="submitFunction(2)">
</form>
</body>
</html>

aarti....@gmail.com

unread,
Mar 7, 2013, 1:11:34 PM3/7/13
to
We have a Submit button which calls a pop up window the window appears but nothing gets submitted , how do we reslove this.

Evertjan.

unread,
Mar 7, 2013, 6:04:08 PM3/7/13
to
wrote on 07 mrt 2013 in comp.lang.javascript:

> We have a Submit button which calls a pop up window the window appears
> but nothing gets submitted , how do we reslove this.

By correcting the coding error you do not show to us.

Submit-buttons do not call other windows, the form-action does, btw.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Stefan Weiss

unread,
Mar 7, 2013, 9:07:37 PM3/7/13
to
On 2013-03-08 00:04, Evertjan. wrote:
> wrote on 07 mrt 2013 in comp.lang.javascript:
>
>> We have a Submit button which calls a pop up window the window appears
>> but nothing gets submitted , how do we reslove this.
>
> By correcting the coding error you do not show to us.

One of his errors was resurrecting a thread from 2004...

<URL:
https://groups.google.com/d/msg/comp.lang.javascript/KfxFKpy9ssM/4kA_ZSBN-msJ>

- stefan
0 new messages