title: Textbox change event not firing in chrome
body: <p>I have a textbox</p>
  
  <pre><code>&lt;input name="tx1" size="10" type="text" id="tx1" class="sample dynamic format" maxlength="10" /&gt;
  </code></pre>
  
  <p>Textbox change and keyup events are bind to two different functions.</p>
  
  <pre><code>$('.sample.dynamic').change(myJsFunction);
  
  
  $('.format').keyup(function (e) {
          formatfn(this, e);
  
      });
  </code></pre>
  
  <p>This is my formatfn:</p>
  
  <pre><code>function formatfn(sValue, e) {
  
  //Do some formatting
  
  $(sValue).val(newVal);
  
  return newVal;
  
  }
  </code></pre>
  
  <p>Both events working fine in IE and firefox but in chrome only keyup function is working and change event is not fired.</p>
  
  <p>if i comment the below line in <strong>formatfn</strong> then change event start firing in chrome as well.</p>
  
  <pre><code>//$(sValue).val(newVal);
  </code></pre>
  
  <p>But i can not comment this line as i need to apply the formatting on every keypress.</p>
  
  <p>I have looked two similar questions <a href="https://stackoverflow.com/questions/6362052/onchange-event-not-firing-on-a-textbox-in-chrome">here</a> and <a href="https://stackoverflow.com/questions/11422210/jquery-on-change-event-for-textbox-class-not-working-in-chrome">here</a> but couldn't find the answer.</p>
  
  <p><strong>Update</strong> : Formatfn is doing various formatting stuff, but just to give you idea about <strong>newval</strong> variable i am adding some related code here:</p>
  
  <pre><code>var newVal = $(sValue).val();
  
  if (newVal != "")
          newVal = parseInt(RemoveCommas(newVal), 10).toString();
  
      var sRegExp = new RegExp('(-?[0-9]+)([0-9]{3})');
  
      while (sRegExp.test(newVal)) {
          newVal = newVal.replace(sRegExp, '$1,$2');
  </code></pre>