I'm using javascript to simulate a disabled select element. I can't actually disable it as the .net validators fail, but that's another story.
I have the following function:
function preventFocus(e) {
if ($(this).hasClass("disabled")) {
e.preventDefault();
this.blur();
}
}
That is called here:
$("#ProvinceID").toggleClass("disabled").bind('focus click dblclick', preventFocus);
Double-clicking the select box in IE still seems to allow the items to be displayed and selected. I tried the IE developer toolbar, and the e.type is showing up as focus and dblclick. Is this an IE bug, or do I need to catch some other event? I also tried focusin.
Thanks!