IE8 & .change function on a form select not working
Having an issue with the .change functionality on a form selector in IE8 which I have not been able to figure out, and is now driving me insane.
When the select is change to an item with a value of 1, it is supposed to set the values of two textboxes to blank. Eg;
- $(function(){
- $('#status').change(function() {
- if (this.value == 1) {
- $('#datetime_hasrecord').val('');
- $('#description').val('');
- }
- });
- });
- <form>
- <select id="status">
- <option>...</option>
- <option>1</option>
- <option>2</option>
- </select>
- <input type="text" id="datetime_hasrecord">
- <input type="text" id="description" value="fsdfsd">
- </form>
This works perfectly in FFX & Chrome - but not in IE8, either in standards or compatibility mode.
The most interesting thing is when I run this through jsfiddle to test it - it works perfectly there, but not when in our actual website (an intranet with a FQDN, and IE8 is set up to run such pages in standards mode, and not the default of compatibility mode).
Using latest version of jQuery (1.4.2-min), and no success. Same issues occurred when trying it in 1.2.6.
Anyone with ideas as to what might be wrong, or what else I can do to diagnose and correct this issue it would be greatly appreciated.