I want to remove spaces from pasted phone numbers into a phone number field prior to the validation being run.
I've applied class="number" to the phone number input field, which validates correctly when anything other than numbers are entered or onsubmit. I've also created an event handler that removes spaces from that field: $(document).ready(function () { $("#phone").bind("blur", function(e){ $("#phone").val($("#phone").val().replace(' ','')); }); });