Hi, I tried many options to check if the multiple attribute is set in my select box, but no one worked. I am trying to determine if the current selection block, which I am getting the values from from several selected so far, is what I tried:
if($(":select[multiple]").length){
alert("worked");
}
and
if($("select").attr("multiple"){
alert("worked");
}
and
if($("select").attr("multiple") != 'undefined'{
alert("worked");
}
HTML:
<select multiple="multiple" style="height:50px" class="classname" name="multi_values[]">
<option value="blah">blah</option>
<option value="blah">blah</option>
<option value="blah">blah</option>
</select>
source
share