473,394 Members | 1,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Do Popup On Submit Form?

Hi,
I have a simple dropdown menu clickable via a submit/go button.

/////////
[HTML]<form name="mymenu" id="mymenu">
<select name="blabla" size=1>
<OPTGROUP label="something">
<option value="a.html">
link a (must open in popup)
</option>
<option value="b.html">
link b (redirected)
</option>
<option value="c.html">
link c (redirected)
</option>
<option value="d.html">
link d (redirected)
</option>
</OPTGROUP>
</select>
<input type="button" onClick="location=document.mymenu.blabla.options[document.mymenu.blabla.selectedIndex].value;" value="Go">
</form>
[/HTML]
//////////////

Normally, the window is redirected to the selected url via onclicking the GO button.

What i'm looking for is, when I select a *specific* url (for example a.html), only a.html must open in a popup window, *while others are keeping redirected* normally. Something related getelementbyid or what?

Thanks,
Soner
Mar 14 '08 #1
3 1575
gits
5,390 Expert Mod 4TB
just use a function and pass the value as a parameter to it. now check for the value and use the window.open() method when the value is a.html ...

kind regards
Mar 14 '08 #2
Got a good answer in somewhere:


[HTML]<input type="button" onclick="formClick();" value="Git">

<script language="JavaScript" type="text/javascript">
function formClick(){
var val = document.getElementById("blabla").options[document.getElementById("blabla").selectedIndex].value;
if(val.indexOf("popup.html") != -1)
window.open("popup.html","Window1","menubar=no,wid th=430,height=360,toolbar=no");
else
document.location = val;
}
</script>[/HTML]


^^Cheers anyway
Mar 18 '08 #3
gits
5,390 Expert Mod 4TB
you may shorten line 5 to this:

Expand|Select|Wrap|Line Numbers
  1. var val = document.getElementById('blabla').value;
kind regards
Mar 18 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Pat | last post by:
Here is how I have been submiting a form to a popup window, this works fine for all netscape versions and all IE versions previous to 6.0.2800.1106. Does anyone know a different way I can submit a...
2
by: Johan | last post by:
I have a form that submit to the same page when double click on a product: <form method="post" action="quotes.asp" name="form1" onDblClick="javascript:formHandler()"> How can I submit the form...
1
by: Marshall Dudley | last post by:
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...
2
by: jrefactors | last post by:
The following will submit the form data to popup by clicking the submit button. I want it will submit the form automatically to the popup, there is no submit button in this page. Basically this...
5
by: midnight_use_only | last post by:
hi all, quick question, how do you submit a form to a parent window from a child popup window? i have the following and all online documentation *suggests* that it should work but it does NOT: ...
4
by: Gabriella | last post by:
Hi, I have a popup window that opens from a page on my website. This popup is a form with several fields. Upon submit button it redirects to a server side ASP page which writes all data to the...
1
by: xhunter | last post by:
Ok, I hope I can get some help here, Basically what I want to do, is to have my form to be submitted to a popup, no problem there, the problem is, I want to initiate this from a button that...
11
by: V S Rawat | last post by:
using Javascript, I am opening a web-based url in a popup window. MyWin1=Window.Open(url, "mywindow") There is a form (form1) in the url in that popup window, I need to submit that form. ...
1
by: dittu | last post by:
How to close the popup window when submitting the form? I have a sample.jsp. In that page one button is there. when button pressed, open popup window contains one "text box" and one " submit...
5
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...
0
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.