i am trying to modify one js file validation rule but unable to do so.
original js code is
var fields = $('#first_step input[type=text], #first_step input[type=password]');
var error = 0;
fields.each(function(){
var value = $(this).val();
if( value.length<4 || value==field_values[$(this).attr('id')] ) {
$(this).addClass('error');
$(this).effect("shake", { times:3 }, 50);
error++;
} else {
$(this).addClass('valid');
}
});
actually it check for type text and type password but i want it to check for select and text area.
i try to modify password to select and textarea but didnt work.
Thanks
Change this
to
If you want to add checking for
selectandtextareawith your existing code.And if you want to check for
selectandtextareaonly then useRead more on Multiple Selectors and all
jQuery selectors