Hey, I hope someone out there can help with this! This is the first time Firefox has given me trouble where IE hasnt, unless of course Im the problem!
Basically, I have a number of checkboxes all with the name "availshifts", with various values. I have an array called "clashingShiftIDs". When a user clicks a checkbox, I need JavaScript to cycle through all of the checkboxes in "availshifts", and if any of them have a value which is present in the array, disable them. The following code sits in a function called by onClick...
if (checkbox.checked == true) { numCheckboxes = document.bookin.availshifts.length
for ( var i=0; i< numCheckboxes; i++ ) {
if ( document.bookin.availshifts[i].disabled == false && document.bookin.availshifts[i].value != checkbox.value ) { // alert ( "Here I am!" ) if ( isInArray(document.bookin.availshifts[i].value, clashingShiftIDs) ) { document.bookin.availshifts[i].disabled = true; } }
} }
So, this code works perfectly in IE6, but it does not work in Firefox 2. In Firefox, nothing seems to happen at all when a checkbox is ticked (besides for a tick appearing in that box). And the error console does not come up with any errors!
What makes it even more frustrating, is if I uncomment the alert in the code above, the alerts appear as it cycles through the other enabled checkboxes, and the necessary checkboxes are disabled one by one, just like they should be!
Very confused! Ive always found though that the most frustrating errors turn out to be my own fault, but I cant figure this one out!