it does not add the disabled attribute to the select
what is in php is this
<div class="input-field col s2 ">
<select id="mododepagofacturaguardar">
<option value="0" disabled selected></option>';
foreach($respuesta2 as $row2 => $item2) {
echo '
<option value="'.$item2["id_modopago"].'">'.$item2["modopago"].'</option>
';
}
echo '</select>
<label>Modo De Pago</label>
</div>
<div class="input-field col s2 ">
<select id="selectorinides" >
<option value="0" disabled selected></option>
<option value="1" >CUOTA INICIAL</option>
<option value="2">DESCUENTO</option>
</select>
<label>SELECCIONA</label>
</div>
what is in js is this
$( function() {
$("#mododepagofacturaguardar").change( function() {
variable=$(this).val();
console.log(variable);
if (variable === "1") {
$(document).ready(function(){
$("#selectorinides").val();
$("#selectorinides").attr("disabled");
$('select').formSelect();
});
} else {
$(document).ready(function(){
$("#selectorinides").removeAttr('disabled');
$('select').formSelect();
});
}
});
});
You can do it in the following way:
EDIT : to make it work with materialize
Sometimes it is necessary to add the change to reflect the changes