Reputation: 3756
I am currently using $.blur(fn();) for form validation, but this only takes effect when the form field loses focus. Is there a way of doing it on keypress to get realtime validation? I suppose I could do the 'poll all fields every second' approach, but I am sure there must be a more elegant way?
Upvotes: 3
Views: 3881
Reputation: 12101
I hope this plugin helps
http://www.geektantra.com/2009/09/jquery-live-form-validation/
Upvotes: 2
Reputation: 5927
Since your using jQuery you should look into the jQuery Validation Plugin. It will take care of the events for you. :)
Upvotes: 2
Reputation: 8145
There are lots of other events you could use. See here: http://docs.jquery.com/Events
I would recommend change or keypress or keydown.
Upvotes: 2