IE8 Change Event issue with Jquery 1.4.2
|Reported by:||budigelli||Owned by:||budigelli|
|Keywords:||needsreview, IE8 textbox change||Cc:||budigelli@…|
This issue is specific to 1.4.2 and fine with 1.3.2.
I have textbox with some watermark applied and as I go in and out of it, with out changing any text, it is raising onchange on IE8.
You could simply produce this with jQuery watermark plugin http://digitalbush.com/projects/watermark-input-plugin/
Here is whats happening.
- Load textbox with empty/blank value.
- Wireup an event handler for focus event that clears the value if its not the watermark value we provided
- Wireup an event handler for blur event that puts watermark value in to the textbox if the value is not empty.
- Wireup an event handler to do same as blur event
- Set some watermark value to this textbox using JS.
Here is whats happening:
- Page loads with textbox
- JS plug-in puts in watermark value in to the textbox (No on change fires)
- On focus, JS plug-in clears watermark value.
- On blur, JS plug-in puts the watermark value back.
IE fires change event at this time; Firefox does not. As IE fires Change event before blur. This same code worked in jQuery 1.3.2.
This is from Microsoft documentation... http://msdn.microsoft.com/en-us/library/ms536912(VS.85).aspx
They quote "This event is fired when the contents are committed and not while the value is changing. For example, on a text box, this event is not fired while the user is typing, but rather when the user commits the change by leaving the text box that has focus. In addition, this event is executed before the code specified by onblur when the control is also losing the focus."
Change History (6)
comment:4 Changed 6 years ago by rwaldron
- Owner set to budigelli
- Priority set to undecided
- Status changed from new to pending