[Vtigercrm-developers] Field Validator classes? [SOLVED]
Alan Lord
alanslists at gmail.com
Mon Apr 9 10:11:00 GMT 2018
Just FYI in case this helps someone else.
It is possible:
> /**
> * Override validator(s) in layouts/v7/modules/Vtiger/resources/validation.js
> **/
> setValidators : function() {
> jQuery.validator.methods.phone = function(value, element, params) {
> try {
> if(!value) return true;
> if(value == 0) return true;
> var tenDigitRegex = /(^[0-9]{10})$/ ;
> var result = tenDigitRegex.test(value);
> if (!result) {
> return false;
> }
> return true;
> } catch(err) {
> console.log(err);
> return false;
> }
> }, jQuery.validator.messages.phone = app.vtranslate('Number must be 10 digits only');
> },
More information about the vtigercrm-developers
mailing list