I tried to make the error message dynamically:
window.Parsley.addValidator('validatorName', {
requirementType: 'string',
validateString: function (value) {
return validateField(value);
},
messages: {
en: 'Invalid ' + someValue
}
});
But it doesn't change, it set someValue to the first value it was set in the page.
How can I change the message based on this value dynamically?
I would put the logic to get the dynamic value into a function and then call that function in your validator.