HI I am having an issue with the custom validator.
In my env i have to add the custom validator and each custom validator have there own custom message, I implemented the way documentation said that is like this
window.Parsley.addValidator('formulaSyntax', {
validateString: function(value) {
return parser.checkSyntax(value);
},
messages: {
en: 'Formula Syntax is wrong'
}
})
this whole thing works fine, but now I want to provide that message using some object or want to return the en part using a function like
window.Parsley.addValidator('formulaSyntax', {
validateString: function(value) {
return parser.checkSyntax(value);
},
messages: {
en: i18next.t('feedback.wrongSyntax')
}
})
This does not work. Is there a way I can provide the value using an object or funcion?
HI I am having an issue with the custom validator. In my env i have to add the custom validator and each custom validator have there own custom message, I implemented the way documentation said that is like this window.Parsley.addValidator('formulaSyntax', { validateString: function(value) { return parser.checkSyntax(value); }, messages: { en: 'Formula Syntax is wrong' } })
this whole thing works fine, but now I want to provide that message using some object or want to return the en part using a function like
window.Parsley.addValidator('formulaSyntax', { validateString: function(value) { return parser.checkSyntax(value); }, messages: { en: i18next.t('feedback.wrongSyntax') } }) This does not work. Is there a way I can provide the value using an object or funcion?