Closed msev closed 1 year ago
Can you give me an example to check? I can see that it works properly here: https://codepen.io/sha256/pen/JezmLp
Sorry for not being precise.
It's related to addValidator
Before 1.0.0, data-pristine-required-message
was stronger than the message in addValidator
, this is no longer valid since version 1.0.0.
Pristine.addValidator(
'required',
function(value) {
if (this.type === 'radio' || this.type === 'checkbox') {
return this.pristine.self.form.querySelector('[name="' + this.name + '"]:checked');
} else {
return value.trim() !== '';
}
},
'',
1,
true
);
Change the line ''
to false
solves my problem
Pristine.addValidator(
'required',
function(value) {
if (this.type === 'radio' || this.type === 'checkbox') {
return this.pristine.self.form.querySelector('[name="' + this.name + '"]:checked');
} else {
return value.trim() !== '';
}
},
false, <----- this line
1,
true
);
Sorry to have wasted your time and thank you for keeping this library alive!
Hi @sha256
Since version 1.0.0, All errors messages are properly injected except for the required one.
Can you check please ?