Skip to content

Instantly share code, notes, and snippets.

@curtiswilkinson
Created October 1, 2015 06:42
Show Gist options
  • Save curtiswilkinson/bad56257eb14e48f0724 to your computer and use it in GitHub Desktop.
Save curtiswilkinson/bad56257eb14e48f0724 to your computer and use it in GitHub Desktop.
Remove all non-numerical values from fields
<script type="text/javascript">
$("#bill_phone, #ship_phone").keyup(function () {
this.value = this.value.replace(/[^0-9\.]/g,'');
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment