guillaumepotier / Parsley.js

Validate your forms, frontend, without writing a single line of javascript
http://parsleyjs.org
MIT License
9.05k stars 1.32k forks source link

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

Open gregg-cbs opened 3 years ago

gregg-cbs commented 3 years ago

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!

marcandre commented 3 years ago

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

gregg-cbs commented 3 years ago

Thanks!

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

marcandre commented 3 years ago

Good point, I'm removing that section altogether 👍