Skip to content

Instantly share code, notes, and snippets.

@coreyrothwell
Created June 27, 2013 20:03
Show Gist options
  • Save coreyrothwell/5879880 to your computer and use it in GitHub Desktop.
Save coreyrothwell/5879880 to your computer and use it in GitHub Desktop.
jQuery replace input field commas. Just add a .no-comma class to the input and include this.
$(function(){
$('.no-comma').on('input',function(e){
var input = $(this),
newVal = input.val().replace(/\,/gi,'');
input.val(newVal);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment