Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save redteam-snippets/3249228 to your computer and use it in GitHub Desktop.
Save redteam-snippets/3249228 to your computer and use it in GitHub Desktop.
javascript: limit characters in field example
$('#myField').bind('keyup', function (e) {
$(this)[0].value = $(this)[0].value.replace(/[^0-9\.]/g, '');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment