473,508 Members | 2,088 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Open a popup on SOME submit buttons

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

Jul 23 '05 #1
1 1882
Marshall Dudley wrote:
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?


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>
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3199
by: Scott | last post by:
Here is the scenario. I need to launch a popup using window.open, but can't pass everything i need to pass on the querystring. So I thought I would set a cookie. Basically I do: ...
7
1764
by: Merlin | last post by:
Hi there, I have a problem with opening new windows with JS. If the webpage did not complete loading due to any reason a click on a link which is supposed to open a small new other window loads...
1
5398
by: Jorge Ponte | last post by:
hi I have a Web User Control (ascx) - lets call it "My_WUC" - in a Web form. In that WUC I want have a textbox and a button. I want to click on the button and open a popup (I use javascript for...
4
8144
by: jwlum | last post by:
I have the following problem under Internet Explorer only: 1. User fills out form data (myform.php) and clicks a button that fires myFunction() 2. myFunction() spawns a "hello, world" popup page...
13
3217
by: Seth Grimes | last post by:
Hello all, I want to open a window when a user leaves my site. I set up a function called by onUnload. To skip the window.open if the user hasn't left my site, I set a variable in my links and...
3
2737
by: Learner | last post by:
Hello, I have two buttons on one of my VehicleDetails.aspx page. Obiviously these two buttons takes the user to two different pages. Now my client is interested in having a linkbutton instead of...
6
1662
by: seberino | last post by:
The following web page puts a report in a *popup window* by clicking the "Generate Report" button.... http://moneycentral.msn.com/investor/research/printrep.asp?Symbol=BBBY How can I grab this...
1
3874
by: Merlin Morgenstern | last post by:
Hi there, I do have a JS-function that does open windows in a specific format to display small pices of information, like member comments. Since a while I have found that this will not work on...
5
10847
by: =?Utf-8?B?SmFtZXMgUGFnZQ==?= | last post by:
Hi all Have a couple of issues with the modal popup extender (asp.net 3.5, vb.net, visual studio 2008): I have created a user control (e-mail enquiry form) which is designed to accept text...
0
7225
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7124
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7326
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7385
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5629
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5053
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3182
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1558
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.