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.
https://just-validate.dev/
Other
525 stars 90 forks source link

Silent revalidate #138

Open AndiLeni opened 11 months ago

AndiLeni commented 11 months ago

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.

pravaliterabricoman commented 11 months ago

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

PiemP commented 9 months ago

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