Skip to content

Instantly share code, notes, and snippets.

@Riaan-ZA
Created February 20, 2013 08:23
Show Gist options
  • Save Riaan-ZA/4993890 to your computer and use it in GitHub Desktop.
Save Riaan-ZA/4993890 to your computer and use it in GitHub Desktop.
Jquery Validate - Validate Phone number
$.validator.addMethod("phoneNumber", function(value, element) {
var filter = /^[0-9-+]+$/;
if (filter.test(value)) {
return true;
}
else {
return false;
}
}, "Please enter a valid phone number");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment