Parsley.js icon indicating copy to clipboard operation
Parsley.js copied to clipboard

What are the accepted values for 'assert' in addError method?

Open gregg-cbs opened this issue 4 years ago • 3 comments

In the docs we can use the addError method to programmatically add an error to a field: addError(name, {message: , assert: , updateClass: true});

One of the properties we can pass is assert what is assert and what values does it accept? I cannot find the answer for this anywhere.

Thanks!

gregg-cbs avatar Dec 02 '20 16:12 gregg-cbs

assert is elsewhere in the code named constraint, it is used to lookup the error message if one is not provided (e.g. mincheck) Note that usage of addError is discouraged and shouldn't be needed #1073

marcandre avatar Dec 02 '20 16:12 marcandre

Thanks!

^ if adderror is discouraged, the documentation needs to be updated: https://parsleyjs.org/doc/index.html#ui-for-javascript

gregg-cbs avatar Dec 11 '20 08:12 gregg-cbs

Good point, I'm removing that section altogether 👍

marcandre avatar Dec 11 '20 18:12 marcandre