Script does not work in IE but works normally in other browsers, the error occurs in: jQuery(central).prop("disabled", false);
and the message I get is:
SCRIPT5009: 'central' is not defined.
I've tried .prop
and .attr
.
JavaScript:
function carregarCentrais() {
if (jQuery("#selectEmissor").val() != -1) {
jQuery(central).prop("disabled", false);
central.setAttribute('class', 'input g270');
jQuery("select#central option").remove();
var selectCentral = jQuery('#central');
jQuery("#central").val(-1);
if (jQuery("#selectEmissor").val() != null) {
jQuery.ajax({
type: "get",
url: "preencheCentrais.do",
data: 'selectEmissor=' + jQuery("#selectEmissor").val(),
success: function(listaCentrais) {
jQuery.each(listaCentrais, function(i, central) {
selectCentral.append('<option value="' + central.codigo + '">' + central.descricao + '</option>');
});
jQuery("select#central").prepend("<option value='-1' selected='selected'></option>");
},
error: function() {
alert("Erro ao pesquisar central pelo emissor");
}
});
}
} else {
central.setAttribute('class', 'input g270 read-only');
jQuery("select#central option").remove();
jQuery(central).prop("disabled", true);
}
sucursal.setAttribute('class', 'input g270 read-only');
jQuery("select#sucursal option").remove();
jQuery(sucursal).prop("disabled", true);
}
HTML:
<td>
<springform:select id="central" class="input g270 read-only" path="extratoLancamento.central" value="${form.extratoLancamento.central}" onchange="carregarSucursais();" style="width: 250px;" disabled="true"></springform:select>
</td>