1
Script does not work in IE but works normally in other browsers, error occurs in: jQuery(central).prop("disabled", false);
and the message I get is:
SCRIPT5009: 'central' is not set.
I’ve tried to .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>
And what it should be
central
? It is not defined in the code.– Woss
is, I just did not put, I will make an Edit, but at last it works in other browsers, but in IE not
– Stenio Vilar
But it should be a variable
central
or is the element#central
? There you put the definition of#central
. Spring is the same?– Woss