I have a form in which if a store has not been selected, it cannot write a reference, so I have it disabled, but the function does not perform the action.
<label for="warehouse">* Almacén</label>
<select id="warehouse_id" onChange="myDisFunction()">
... </select>
<label for="inventory_id">* Referencia</label>
<input type="text" id="inventory_id">
<script>
function myDisFunction() {
var x = document.getElementById("warehouse_id").value;
if(warehouse_id != null){
inventory_id.disabled =false;
}
}
</script>