JQuery real-time validation

I am currently using $ .blur (fn ();) to validate the form, but this only works when the form field loses focus. Is there a way to do this when I press a key to get real-time confirmation? I suppose I could use "polling all the fields every second," but I'm sure there should be a more elegant way?

+3
source share
4 answers

You can use $ .keyup

+4
source

There are many other events that you could use. See here: http://docs.jquery.com/Events

I would recommend changing or pressing a key or pressing a key.

+2
+2

Source: https://habr.com/ru/post/1712135/


All Articles