I have a radio button on my form that onchange sets a value on the form and also fires of an ajax call to a partial page.
What i have found is that the event does not fire until after the control has lost focus.
This has a big impact when the control you click to cause the loss in focus is the WIH Complete button in BF12.
If there a workaround for this?
What i have found is that the event does not fire until after the control has lost focus.
This has a big impact when the control you click to cause the loss in focus is the WIH Complete button in BF12.
If there a workaround for this?
RE: WM5 - Radio Button onchange fires after lost focus
Generally when using events for radio buttons you will want to use the 'onclick' event trigger rather than 'onchange'.
For most of the controls, the browser fires onchange once the focus leaves the control after its value has been changed, which is probably ok for a text box, but not so good for a radio button, as you expect the new value to 'take effect' as soon as you select it.
If you use the 'onclick' event trigger instead, then the processing will happen as soon as the new radio button value is clicked. The browsers normally fire this event when using the keyboard to select the radio button value as well, so you don't lose any accessibility with this option.
I hope this helps.
Regards,
Gerard