IE8 & .change function on a form select not working

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;

  1. $(function(){
  2.         $('#status').change(function() {
  3.     if (this.value == 1) {
  4.         $('#datetime_hasrecord').val('');
  5.         $('#description').val('');
  6.     }
  7.     });
  8. });
  1. <form>
  2. <select id="status">
  3.     <option>...</option>
  4.     <option>1</option>
  5.     <option>2</option>
  6. </select>
  7. <input type="text" id="datetime_hasrecord">
  8. <input type="text" id="description" value="fsdfsd">
  9. </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.