crmForm.all.new_bit.onchange = function() {
alert(“I changed”);
};
It only took me a second to see what was happening. First the onchange event will not fire until the radio button group looses focus or the blur() event is called on the radio button. After explaining this to my teammate I got the next logical question of, “Well how do you make the event fire when the user clicks on the radio button?” This was an easy one to answer, I said, “Replace onchange with onclick.” So he changed his to code to look like this
crmForm.all.new_bit.onclick = function() {
alert(“I changed”);
};
- onchange does not fire until radio button looses focus or blur() is called
- Use onclick if you want an event to fire as soon as a radio button is clicked.
No comments:
Post a Comment