I have the following code that unlocks the dropdown by removing the disabled attribute with the removeAttr function. This example doesn't work in Mozilla Firefox 24 for Ubuntu. However it works perfectly fine if added an alert after the RemoveAttr function as shown in the next example:
$("#dropdown1").change(function() {
$('#dropdown2').find('option').remove().end();
if (obj[$(this).val()] !== undefined)
{
$('#dropdown2').removeAttr('disabled');
$('#dropdown2').append('<option></option>' + obj[$(this).val()]);
$('#dropdown2').attr('required', true);
}
else
{
$('#dropdown2').attr('disabled', true);
$('#dropdown2').attr('required', false);
}
});
Working example:
$("#dropdown1").change(function() {
$('#dropdown2').find('option').remove().end();
if (obj[$(this).val()] !== undefined)
{
$('#dropdown2').removeAttr('disabled');
alert("REMOVED");
$('#dropdown2').append('<option></option>' + obj[$(this).val()]);
$('#dropdown2').attr('required', true);
}
else
{
$('#dropdown2').attr('disabled', true);
$('#dropdown2').attr('required', false);
}
});
Example with .prop doesn't work as well:
$("#dropdown1").change(function() {
$('#dropdown2').find('option').remove().end();
if (obj[$(this).val()] !== undefined)
{
$('#dropdown2').prop('disabled', false);
$('#dropdown2').append('<option></option>' + obj[$(this).val()]);
$('#dropdown2').attr('required', true);
}
else
{
$('#dropdown2').prop('disabled', true);
$('#dropdown2').attr('required', false);
}
});