For example, if there are two inputs for image upload, images must be uploaded:
html
js
$(".myfile").each(function(){
if($(this).val() == "") {
alert("Please upload pictures!");
flag = 0;
}
});
}else if($(".myfile").length !=2 ){
alert("No less than 2 pictures!");
}