Pristine icon indicating copy to clipboard operation
Pristine copied to clipboard

validate() silent option is ignored / not working

Open Maybach91 opened this issue 4 years ago • 2 comments

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.

Maybach91 avatar Nov 11 '20 11:11 Maybach91

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

hirbod avatar Nov 19 '20 15:11 hirbod

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

essentin avatar Dec 16 '20 15:12 essentin