Advertisement
Guest User

Untitled

a guest
Aug 30th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. // On Key Up Event Handler to ensure Numeric Inputs adhere to their Max Length
  2. $('input[type=number]').on('keyup', function (event) {
  3. var maxlength = $(this).attr('maxlength');
  4.  
  5. if (this.value.length > maxlength) {
  6. this.value = this.value.slice(0, maxlength);
  7. }
  8. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement