Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have a project that requires some values to get updated with JavaScript from an HTML radio change event.

For some reason in IE, it seems that the onchange event isn't called until the radio has lost focus. Unfortunately due to the way the code is setup, I can't use the click event and have to use the change event.

Does anyone know of a way to force IE to raise the change event as soon as the check is changed rather than when it looses focus?

Thanks.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
511 views
Welcome To Ask or Share your Answers For Others

1 Answer

Just to add, you can force IE to trigger the onChange event using the onClick event, so if you are allowed use the onClick event to trigger the change event, this should do it:

<input type="radio" onclick="this.blur();"/>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...