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?
+1
A:
There are lots of other events you could use. See here: http://docs.jquery.com/Events
I would recommend change or keypress or keydown.
Clyde
2009-07-08 19:02:40
Ahh thanks, I am not sure how I missed it :)
Meep3D
2009-07-08 19:36:41
+1
A:
Since your using jQuery you should look into the jQuery Validation Plugin. It will take care of the events for you. :)
MitMaro
2009-07-08 19:08:32
+1
A:
I hope this plugin helps
http://www.geektantra.com/2009/09/jquery-live-form-validation/
GeekTantra
2009-09-23 02:32:23