Last active
December 17, 2016 00:46
-
-
Save 0-Sony/82b666869a1ed83be2a23d976530d8c8 to your computer and use it in GitHub Desktop.
Custom Validation[FR] Js for Magento
This file contains 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
Validation.addAllThese([ | |
['validate-zip-fr', 'Please enter a valid zip code. For example 75001.', function (v) { | |
return Validation.get('IsEmpty').test(v) || /(^\d{5}$)/.test(v); | |
}], | |
['validate-mobile-fr', 'Please enter a valid cellphone number. For example 0601020304.', function (v) { | |
return Validation.get('IsEmpty').test(v) || /(^[0][6-7]\d{8}$)/.test(v); | |
}], | |
['validate-fix-fr', 'Please enter a valid cellphone number. For example 0101020304.', function (v) { | |
return Validation.get('IsEmpty').test(v) || /(^[0]([1-5]|9)\d{8}$)/.test(v); | |
}], | |
['validate-phone-fr', 'Please enter a valid cellphone number. For example 0101020304.', function (v) { | |
return Validation.get('IsEmpty').test(v) || /(^[0]([1-7]|9)\d{8}$)/.test(v); | |
}], | |
['validate-city', 'Please enter a valid city. For example Paris.', function (v) { | |
return Validation.get('IsEmpty').test(v) || /(^[a-zA-Zà-ÿÀ-Ÿ-\s]+$)/.test(v); | |
}], | |
['validate-address-fr', 'Please enter a valid address. For example 10 avenue du Général Leclerc.', function (v) { | |
return Validation.get('IsEmpty').test(v) || /(^[0-9]{1,4}[a-zA-Zà-ÿÀ-Ÿ-\s]+$)/.test(v); | |
}] | |
]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment