i have an multi select box given below: Please First see that.
My code:
$("select option:contains( " + data + ")").attr("disabled","disabled");
only helps to disable select option only if data has only one value(not in array)
Here is the problem:
var data = 31/8/2018,30/9/2018
I want to disable select options having values == data ,
so maybe, we need a loop which check data[1] == first option then second then third etc if values matched, that value will be disabled.
then check data[2] == first option then second then third ...etc if values matched, that select option will be disabled.
Result:: Ex. First two option ll be disable Is that Possible
<select class="form-control" multiple="" name="month[]" id="month">
<option value="31/8/2018"> 1 @ 31/8/2018 </option>
<option value="30/9/2018"> 2 @ 30/9/2018 </option>
<option value="31/10/2018"> 3 @ 31/10/2018 </option>
<option value="30/11/2018"> 4 @ 30/11/2018 </option>
<option value="31/12/2018"> 5 @ 31/12/2018 </option>
</select>
$("select option:contains( " + data + ")").attr("disabled","disabled");
datalooks like and where it's being set?