Hi I have a method to disable a select:
function setPersons(adultos){
document.getElementById("perselect").value = adultos;
document.getElementById("perselect").disabled = true;
}
That is called when I load my website. This work without problem.
My problem is when I try to enable it again with a button inside the form.
This is the button code:
<button class="button-big" name="disp" value="clean" id="save" type="button">Limpiar fecha</button>
And this is the method in jQuery to catch it:
$('#save').on('click', function(e) {
document.getElementById("perselect").disabled=false;
document.getElementById("ninselect").disabled=false;
});
The select is disabled when the pages loads, but if I press the button, the click
event is called (I put an alert inside to check it), but the select is always disabled.
What could be happening?