This code validates a set of form elements,
var objects = $(".validated").filter(function (){
return $(this).val() == '';
});
Is there i could also filter for a length of >10, for example?
Thanks!
This code validates a set of form elements,
var objects = $(".validated").filter(function (){
return $(this).val() == '';
});
Is there i could also filter for a length of >10, for example?
Thanks!
Either chain together another filter, or modify the condition.
var objects = $(".validated").filter(function (){
return $(this).val() == '' || $(this).val().length > 10;
});
Alternatively
var objects = $(".validated").filter(function (){
return $(this).val() == '';
}).filter(function(){
return $(this).val().length > 10;
});