Modern, simple, lightweight (~5kb gzip) form validation library written in Typescript, with no dependencies (no JQuery!). Support a wide range of predefined rules, async, files, dates validation, custom error messages and styles, localization. Support writing custom rules and plugins.
removeField clears all of the other errors when called. It should clear the errors or styles only to the selected field. The documentation says it too that it removes validation rules/events/errors from the particular field.
Create a trigger to call removeField() and it will remove all of the errors.
I have "Others" input field. It shows when I select "others" option from the dropdown. I also have an onchange event attached to it, wherein it adds an "others" field as required. When I select a different option, I remove the "others" field. However, when I call removeField from my onChange, it removes all of the errors from the form.
removeField
clears all of the other errors when called. It should clear the errors or styles only to the selected field. The documentation says it too that it removes validation rules/events/errors from the particular field.https://codesandbox.io/s/justvalidate-issue-118-sfytl3?file=/index.html
To reproduce bug
removeField()
and it will remove all of the errors.I have "Others" input field. It shows when I select "others" option from the dropdown. I also have an onchange event attached to it, wherein it adds an "others" field as required. When I select a different option, I remove the "others" field. However, when I call
removeField
from my onChange, it removes all of the errors from the form.https://github.com/horprogs/Just-validate/assets/62165191/31010fe7-af59-4033-a9a9-84608691e172
Is there any other way to override the
removeField
function and remove the error style and label for a specific field only and not all of the errors?