horprogs / Just-validate

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.

Home Page:https://just-validate.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Silent revalidate

AndiLeni opened this issue · comments

Is your feature request related to a problem? Please describe.
I am using computed javascript values in combination with alpinejs for a spet-by-step wizard for a form.
The "next step" button should only get active when the fields on the current step are filled correctly.
However, using revalidateField() to check the fields for errors shows the error labels instantly before the user has made any inputs, because the computed value is calculated instantly.

Describe the solution you'd like
A new method or option for revalidateField() which returns true or false but does not show labels.

I think we also need a silent revalidate() , just to know if the form is valid or not, but without displaying errors.

have you tried with refresh? Probably something like call revalidate and then, in promise, run refresh.