I'm wondering which jQuery events to use for validating form inputs as a user operates on a form. I'd love to just use the change event, but this is apparently only fired for text inputs or textareas when they lose focus -- which is inadequate for validate-as-you-type functionality. Additionally, some events respond to mouse events and also to keyboard events, autocompletion, etc. For example a select input responds to user keystrokes.
Can anyone help me identify approprate event types for the various inputs?
input, type=text = keypress ?
textarea = keypress?
input, type=radio = change? keyup?
input, type=checkbox = change? keyup?
* select = change? keyup?
I've seen two suggested approaches. One is to bind a handling function to a 'salad' of events:
$(selector).bind("propertychange keyup input paste blur", { put data here if necessary }, Selector_Dirty_Handling_Function_Name)
Another is to write code to take a snapshot of the form and its values and then use setInterval (or possibly some event salad) to monitor the form and trigger one's own sort of event when something's value changes.
Any input would be much appreciated.