How To Check If All The Four Multiselect Has Some Value Selected?
I have 4 multiselect which are created dynamically by this fashion var drp_nt = $('', { 'id' : 'drp_' + nt,
Solution 1:
use change event
to check all select box is selected or not using filter()
$("select").change(function () {
var selectedBox = $("select").filter(function () {
returnthis.value != "";
});
if (selectedBox.length == 4) {
alert("4 ckecked")
}
});
For dynamic element
$(document).on("change", "select[id^=drp_]", function(){
var selectedBox = $("select").filter(function () {
returnthis.value != "";
});
if (selectedBox.length == 4) {
alert("4 ckecked")
}
});
Post a Comment for "How To Check If All The Four Multiselect Has Some Value Selected?"