Skip to content

Events for validation #60

Closed
Closed

Description

@CSchulz

Hello,

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.

Activity

  1. modified the milestone: 1.3.0 on Mar 12, 2015
  2. modified the milestones: 1.3.0, on Mar 29, 2016
  3. added a commit that references this issue on Aug 24, 2026
    b6266f5
  4. 66Ton99 commented on Aug 24, 2026

    @66Ton99
    Collaborator

    Fixed in Svaroh/JsFormValidatorBundle, the new home of this bundle, by PR #17.

    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.

    Documentation: 3_21.md.

    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.

    Closing here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions