473,289 Members | 1,756 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,289 software developers and data experts.

MSIE and Firefox...same script....

Hello,

I come back with a problem very strange:
This code works just fine with Firefox but not with MSIE.
With MSIE only if the index is quite low it works, otherwise it shows the
index 0

function checkselected(x,y){
if(x != "0"){
var xcombo = document.getElementById("x");
for (var i = 0; xcombo.options.length - 1;i++){
if(xcombo.options[i].value == x){
xcombo.selectedIndex = i; //should show the selected item: works with
Firefox but not with MSIE 6.

Please I've lost 1 entire day on this problem. Can't believe it !!!!

Bob

Mar 28 '06 #1
1 1338

Bob Bedford wrote:
Hello,

I come back with a problem very strange:
This code works just fine with Firefox but not with MSIE.
With MSIE only if the index is quite low it works, otherwise it shows the
index 0

function checkselected(x,y){
if(x != "0"){
var xcombo = document.getElementById("x");
for (var i = 0; xcombo.options.length - 1;i++){
if(xcombo.options[i].value == x){
xcombo.selectedIndex = i; //should show the selected item: works with
Firefox but not with MSIE 6.

Please I've lost 1 entire day on this problem. Can't believe it !!!!
for (var i = 0; xcombo.options.length - 1;i++)

It's appearing to work, but unless the loop is deleting options, it's a
forever loop.
I'm sure you meant to say:

for (var i = 0; i < xcombo.options.length; i++)

--
S.C.

Mar 28 '06 #2

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

Similar topics

8
by: Mason A. Clark | last post by:
Did I miss something? Perhaps coincident with the advent of Microsoft's SP2, my font sizes seen in MSIE have shrunk to near unreadability. Firefox and Opera are ok but both have minimal font...
3
by: Alan Searle | last post by:
I am building the following web site ... http://www.alse.com/OSD3/ .... (still under construction) with everything displaying more or less OK for me under Firefox and MSIE 6.0 However, one...
4
by: petermichaux | last post by:
Hi, I'm hoping for a reason I'm wrong or an alternate solution... I'd like to be able to dynamically include some javascript files. This is like scriptaculous.js library but their solution is...
1
by: ticmanis | last post by:
Hello, I'm having trouble getting MSIE 6.0 (running on XP SP2) to accept a cookie which works fine in both Firefox and wget. The web server is Boa 0.94.13 (a small embedded server) using PHP...
19
by: pamelafluente | last post by:
Hi Guys, I am trying to include my little script in my html report. I have done an external JS file which contains it. If you remember, you have helped me to detect if the asp page was present...
1
by: johnpsm | last post by:
In MSIE background goes around picture, in Firefox it doesn't? http://home.comcast.net/~johnpsm/life/index.html I given up trying to get the images in the same location and have accepted the...
6
by: raoul | last post by:
MSIE 6.0 apparently does not support protyping with objects created with document.createElement, while Firefox does. I tested it by typing it into the adress bar, but it also appears to be the...
7
by: mavigozler | last post by:
IE7 does not appear to set an event on contained text inside SPAN elements whose 'onclick', 'onmouseover', and 'onmouseout' events, defying the HTML recommendation. Firefox appears to conform. ...
5
by: chozze | last post by:
Hi, I am new to html and css. I know there is some bugs in interpreting css in msie. I have this page www.restauraceskalka.cz/m2.html . In firefox evertyhing is just fine but in msie picture...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.