I have a textbox with an onchange event. Why does this event not fire when the user uses the autocomplete feature to populate the textbox?
I am working with Internet Explorer. Is there a standard and relatively simple solution to workaround this problem, without me having to disable the autocomplete feature?
Some fields in a form will look for a change before the form can be submitted. When a field is Autofilled by Kiosk Pro, the field doesn't notice a change, so an "onChange event" will need to be triggered. This screening happens post factum meaning that the page will load before it is blocked.
onchange is not fired when the value of an input is changed. It is only changed when the input's value is changed and then the input is blurred. What you'll need to do is capture the keypress event when fired in the given input. Then you'll test the value of the input against the value before it was keypressed.
The onchange event occurs when the value of an element has been changed. For radiobuttons and checkboxes, the onchange event occurs when the checked state has been changed.
The onchange attribute fires the moment when the value of the element is changed. Tip: This event is similar to the oninput event. The difference is that the oninput event occurs immediately after the value of an element has changed, while onchange occurs when the element loses focus.
Last time I had that issue, I ended up using the onpropertychange
event for Internet Explorer instead. I read about that here on MSDN: it is the recommended way to get around it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With