Created
March 10, 2023 08:20
-
-
Save Korveld/77f63aa91dddebc5550af8b01fce8a60 to your computer and use it in GitHub Desktop.
Jquery validate plugin add custom rules
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
| $.validator.addMethod('intlTelInput', function (value, element) { | |
| return $(element).intlTelInput("isValidNumber"); | |
| }, commonjs_script_env.translate.phone_number); | |
| $.validator.addMethod('emailExt', function(value, element, param) { | |
| return value.match(/^[a-zA-Z0-9_\.%\+\-]+@[a-zA-Z0-9\.\-]+\.[a-zA-Z]{2,}$/); | |
| }, commonjs_script_env.translate.email); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment