Html
<input type="text" name="test[]" class="test">
How can I check every input has value? This is what I tried but if one the input has value it will not alert the message
Script
var x = new Array();
var message = "";
jQuery("input[name='test[]']").each(function(){
var y = jQuery(this).val().toLowerCase();
if(y){
x.push(y);
}
});
if(x.length === 0){
message += "missing";
};
if(message != ""){
alert(message);
}
EDIT I want to alert if one of input has no value