jquery - Keyup Validation - Left/Right Arrows Not Working in IE -


i'm using jquery limit characters can entered (specifically on keyup) in textbox (allow numbers, decimal points , left/right arrows, no other characters).

html:

<input class="decimal" id="id" type="text" name="name" value="" aria-invalid="true"> 

jquery:

$('.decimal').keyup(function(){     var val = $(this).val();      if(event.which>=37 && event.which<=40)                 {                     return false;                  }      if(isnan(val)){          val = val.replace(/[^0-9\.]/g,'');          if(val.split('.').length>2)               val =val.replace(/\.+$/,"");     }     $(this).val(val);  }); 

this solution working me, running issue left/arrows not work in ie (but work in chrome, ff, safari, etc.). doing wrong?


Comments

Popular posts from this blog

IF statement in MySQL trigger -

c++ - What does MSC in "// appease MSC" comments mean? -

javascript - Blogger related post gadget image Resize s72-c [ Need Expert Help ] -