Click to See Complete Forum and Search --> : Advanced JavaScript Issue in IE


radynski
12-04-2002, 04:07 PM
Okay, I have code here that works perfectly in Netscape 6, but not in IE. I put in an alert to try to figure out what was going on, and then it started working. The kicker is, that it only works in IE when the alert is there. Without it, the page submits with the last element selected, instead of all of them, like it's supposed to.

function selectAll() {
document.editBrowser.browsers.multiple = true;
var count = 0;
while(document.editBrowser.browsers.options[count]) {
document.editBrowser.browsers.options[count].selected = true;
count = count + 1;
alert("This works in Netscape perfectly,\nbut as soon as I take out this alert, it stops working in IE.");
}
}

Any insights would be most appreciated.

radynski
12-05-2002, 07:46 AM
Thanks for the response, but your code does the same thing. It doesn't work unless I put an alert in the loop. I doubt it changes anything, and I don't know why this would matter, but I'm working in a ColdFusion page.

Has anyone ever heard of this? I mean alerts are a standard way to debug JavaScript. I've never encountered an instance where it only works with the alert.

Desperate to figure out what IE is doing...

radynski
12-06-2002, 07:25 AM
Yeah, I've never heard of it either, but it's happening. I tried to use the code from your page, but it's giving me the same problems. I think maybe it has to do with the fact that it's a single select box that I change to a multiple in the same function. Even if that is the case, I've still never encountered a problem like this before. And the fact that it works fine in Netscape really bugs me.