To add a validity test to all text input elements:
$("input[@type='text']").change( function() { // check input for validity });