You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have overwritten the showErrors method with the given example and noticed all fields get a ready class regardless if they are already checked or not (perhaps it is related to the UniqueEntity check on the same field).
In general I would like to see 3 kinds of events, which are fired during the validation process, at the moment showErrors seems to be called before and after validation.
Validating
Success
Failure
For long running validations or similar the validating event would be great.
The library now dispatches native CustomEvent objects on the DOM node of the element it validates:
per element: svaroh:validating, svaroh:success, svaroh:failure
once per run of validateRecursively() on a root form: svaroh:form-validating, svaroh:form-success, svaroh:form-failure
detail.element carries the element, detail.errors the messages. Element level events bubble, so they can be delegated on the form, and the result events wait for pending asynchronous constraints such as UniqueEntity before they fire. Any number of listeners can be attached without replacing showErrors or onValidate.
The fix is in the svaroh/jsformvalidator-bundle package on main. It is not backported to fp/jsformvalidator-bundle, which stays on its 1.x line, so upgrading to the new package is what picks it up.
Activity
feat(js): dispatch validation lifecycle events
66Ton99 commentedon Aug 24, 2026
Fixed in Svaroh/JsFormValidatorBundle, the new home of this bundle, by PR #17.
The library now dispatches native
CustomEventobjects on the DOM node of the element it validates:svaroh:validating,svaroh:success,svaroh:failurevalidateRecursively()on a root form:svaroh:form-validating,svaroh:form-success,svaroh:form-failuredetail.elementcarries the element,detail.errorsthe messages. Element level events bubble, so they can be delegated on the form, and the result events wait for pending asynchronous constraints such asUniqueEntitybefore they fire. Any number of listeners can be attached without replacingshowErrorsoronValidate.Documentation:
3_21.md.The fix is in the
svaroh/jsformvalidator-bundlepackage onmain. It is not backported tofp/jsformvalidator-bundle, which stays on its 1.x line, so upgrading to the new package is what picks it up.Closing here.