Created
April 27, 2017 11:51
-
-
Save delphinpro/f44e9a972f2b3bb15fc340fdead90060 to your computer and use it in GitHub Desktop.
Phone numer validator for jQuery Form Validator (http://www.formvalidator.net/)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $.formUtils.addValidator({ | |
| name : 'tel', | |
| validatorFunction: function (value, $el, config, language, $form) { | |
| return /^((8|\+7)[\- ]?)?(\(?\d{3}\)?[\- ]?)?[\d\- ]{7,10}$/.test(value); | |
| }, | |
| errorMessage : 'Please enter a valid phone number', | |
| errorMessageKey : 'badTel' | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment