title: CRM 2011 onChange event handler not firing when field has been set by JavaScript
body: <p>I'm adding some JavaScript to a CRM 2011 form and I'm seeing behaviour I don't understand.  (I've radically simplified
  this example to get to the heart of the problem.)</p>
  
  <p>I have a field called "new_myfield" which is radio button, and I'm firing a JavaScript function OnChange to set it to false.
  If I use the following script, all works out fine, I can run the script again and again, and every time it sets the field back to 
  false:</p>
  
  <pre><code>var myField = Xrm.Page.getAttribute("new_myfield");
  myField.setValue(false);
  </code></pre>
  
  <p>Of course, what's actually happening is the script is firing twice, because when the field is set to false, this again fires
  the script, which again sets it to false.  I've verified this by putting alerts in the script.</p>
  
  <p>But I actually only want to run this script when a user has set the field to 'true', so I change it to this:</p>
  
  <pre><code>var myField = Xrm.Page.getAttribute("new_myfield");
  if (myField.getValue() == true) {
      myField.setValue(false);
  }
  </code></pre>
  
  <p>The script runs once as expected and sets the field to 'false', but then the next time I manually set the radio button to 'true', the script doesn't run.  It doesn't even fire.  It's like the onchange event handler hasn't recognised anything has happened.  It's only when I then manually set the button
  back to 'false' that the script runs again as expected.</p>
  
  <p>It's as if the script needs to run through twice (as in the first example) for this to work.</p>
  
  <p>Anyone any ideas why this is happening?</p>