Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gregg-cbs opened this issue Dec 2, 2020 · 3 comments
Open

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

gregg-cbs opened this issue Dec 2, 2020 · 3 comments

Comments

@gregg-cbs
Copy link

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
Copy link
Collaborator

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
Copy link
Author

Thanks!

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

@marcandre
Copy link
Collaborator

Good point, I'm removing that section altogether 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants