What's the best JS library to use for form validation?

  • 0
    Good afternoon!
    There is a task to do form validation so that after the user has removed the focus from the field, under it immediately displays an error that the field is entered correctly, or in case of correct input, it is highlighted in green, or something else, in general, so that this event can be processed. So far I have only found such an example . But here the validation is triggered only when the form submit button is pressed. And you need to do something like this . Can someone have an example of how to do this? I'll be very thankful.
    JavaScript Anonymous, Mar 31, 2019

  • 2 Answers
  • 0
    I don't understand what is the problem with Vanilla js? There is a submit, change, input event; a bunch of type in input; built-in API for validation (form.validity). MDN article
    Caleb Solis

  • 0
    This example listens for the submit event.

    But no one bothers you to listen to change or even input.
    Avery Maxwell

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!