...

View Full Version : MSIE: checkbox onchange



b_hole
11-01-2006, 09:24 PM
I have this simple function:

function SH() {
if (document.getElementById("isID")) {
document.getElementById("isID").style.display="none";
document.getElementById("mycheckbox").onchange=function() {
document.getElementById("isID").style.display=(this.checked)?"block":"none";
}
}
}That works on Firefox, but in MSIE not: is seems as if IE gets "onchange" for the checkbox only if its value is true and only if the user clicked on the LABEL of the checkbox. Also, if the user clicks the checkbox itself that function don't work at all.

Why?

_Aerospace_Eng_
11-01-2006, 10:52 PM
Use onclick instead of onchange.

b_hole
11-02-2006, 08:30 AM
So simple. Thanks.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum