Select not Selected
javascript, jquery
Solution
function doconfirm() {
if ($('select').each(function() {
if($(this).val() == '') {
alert("Please Select All Fields");
return(false);
}
});
}
Problem
I have a form with 4 dropdowns on it. The default selected option in all the dropdowns is "Please Select". I want to use Jquery to make sure all dropdowns have a value before the page is submitted, but my code only works on the first one. Does anyone have a way that I can check all of the dropdowns at once? ``` function doconfirm() { if ($('select').val() == '') { alert("Please Select All Fields"); } } ``` I'm sure I am missing something but I cant figure it out. Thanks