Pristine
Pristine copied to clipboard
validate() silent option is ignored / not working
I’m trying to valid a specific input field as silent
. According to the documentation it should be simple like pristine.validate(input, true);
. But its ignored.
Look at line 25: https://codepen.io/Maybach/pen/mdEQjWN
// Silent is ignored
pristine.validate(elem, true);
pristine.addError(elem, "Testerror Message");
Expected: Shows only "Testerror Message" on page load.
Also is it intended that i have to validate the input first to add my custom error? I’m trying to get a workaround for #51 where i request the API without the addValidators function.
I can confirm that "silent" does nothing for me too. The errors are still outputed, though I need to do some validation without error output @sha256
There is a bug related to pristine.addError
, see https://github.com/sha256/Pristine/issues/57
In short, same as in https://github.com/sha256/Pristine/issues/57, if you add elem.pristine.errors = []
before addError
than it works