Hi everybody,
Im trying to use that piece of javascripts for 2 combo box in my web site but its nt working on Firefox but it works well in IE 6.0 :S
Can someone please help me in solving this problem.
I included the js functions.
The first ComboBox is when the user select an option the URL must may be a pop up and the second ComboBox needs to open the URL within the page itself.
Both are using the onChange() function.
Thanks for a quick reply or solutions ;)
The codes are as follows:
=> included in the <head> - <script type="text/javascript">
-
function MM_goToURL() { //v3.0
-
var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
-
for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
-
}
-
function MM_openBrWindow(theURL,winName,features) { //v2.0
-
if (theURL != "") {
-
window.open(theURL,winName,features);
-
}
-
}
-
function MM_swapImgRestore() { //v3.0
-
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
-
}
-
</script>
-
-
------------------
-
-
<body>....
-
-
<select name="select" class="booking" onChange="MM_openBrWindow(this.options(this.selectedIndex).value,'bookwindow','')">
-
<option selected="selected">--------</option>
-
<option value="http://www.google.com">1</option>
-
<option value="http://www.google.com">2</option>
-
<option value="http://www.google.com">3</option>
-
<option value="http://www.google.com">4</option>
-
<option value="http://www.google.com">5</option>
-
</select>
-
-
-------------
-
-
-
<select name="select2" class="booking" onChange="MM_goToURL('parent',this.options(this.selectedIndex).value);return document.MM_returnValue">
-
<option selected="selected" value="#">--------</option>
-
<option value="http://www.google.com">1</option>
-
<option value="http://www.google.com">2</option>
-
<option value="http://www.google.com">3</option>
-
<option value="http://www.google.com">4</option>
-
<option value="http://www.google.com">5</option>
-
</select>
6 3821
First mistake: testing in IE first.
IE is sometimes lax on syntax. options is an array, so you need square brackets [], not round brackets/parentheses (), i.e. options[...]
Please enclose your code using code tags.
First mistake: testing in IE first.
IE is sometimes lax on syntax. options is an array, so you need square brackets [], not round brackets/parentheses (), i.e. options[...]
Please enclose your code using code tags.
Ooops sorry about the codes...
You are right to say TESTING IN IE FIRST IS VERY BIG MISTAKES ...
IE really S...ks if u work wiz CSS 2.0 !!!
Well i will try ur suggestion n come back to give more details..
thanks anyway :)
First mistake: testing in IE first.
IE is sometimes lax on syntax. options is an array, so you need square brackets [], not round brackets/parentheses (), i.e. options[...]
Please enclose your code using code tags.
can you please give me an example using the above codes of the proposed solution using array instead of () ...
thanks
Either:[html]<select name="select" class="booking" onchange="MM_openBrWindow(this.options[this.selectedIndex].value,'bookwindow','')">[/html]or [html]<select name="select" class="booking" onchange="MM_openBrWindow(this.value,'bookwindow', '')">[/html]this.value is a shortcut.
Either:[html]<select name="select" class="booking" onchange="MM_openBrWindow(this.options[this.selectedIndex].value,'bookwindow','')">[/html]or [html]<select name="select" class="booking" onchange="MM_openBrWindow(this.value,'bookwindow', '')">[/html]this.value is a shortcut.
Damn it ... u r great :D
I was with that with more than 2 hrs ... loolllllzzz
It works :D
Thanks a lot ;)
many thanks again
You're welcome. Pleased it's now working.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Frowning Freezer |
last post by:
I have a function in an external javascript file which I fire from an
onChange event in a <SELECT> tag. Everything works fine in IE but not
in Netscape/Mozilla/Opera. This is my onChange statement:...
|
by: Asit |
last post by:
In JavaScripts checks for an onChange event against the value of the
textbox at the time of the last onChange event. Since an onChange
Event never fired after you changed the text first time ,...
|
by: Bart van Deenen |
last post by:
Hi all
I have a script where I dynamically create multiple inputs and selects
from a script. The inputs and selects must have an associated onchange
handler.
I have the script working fine on...
|
by: Pascal Batzli Jr |
last post by:
Hello,
I have a strange situation happening on the code below. When I first
load the page, as I change any of the three combo boxes I have created,
the onchange event is fired and the form should...
|
by: jab3 |
last post by:
Hello. I"m new to this group, and to JavaScript in general, so please
forgive me if I breach local etiquette. I'm trying to implement some
client-side 'dynamic' validation on a form. I'm having...
|
by: Bruno Alexandre |
last post by:
Hi Guys,
I'm having a HUGE problem with Javascript under IE, the code below belongs
to a page
http://filterqueen.brinkster.net/test.aspx
it works fine under Firefox, but not in IE...
does...
|
by: Peter |
last post by:
Does anyone know how to trap SelectedIndexChanged event on the client side
for the following control?
http://www.metabuilders.com/Tools/ComboBox.aspx
I have tried...
|
by: Jan Doggen |
last post by:
Hello all,
I have a SELECT like this (the 'alert()s are temporary):
<FORM method="POST"
action="/scripts/runisa.dll?OVB2.132964:PGSPLITVACAFMELDEN:1095144287.9159"
id="hulpform"...
|
by: Mister Joe |
last post by:
I have a page and if the user has javascript enables I am trying to
dynamically change a link to a sitemap to a dropdown menu (that when
the option is changed will forward the user to another...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
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
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
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...
|
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,...
|
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...
|
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...
| |