Skip to content Skip to sidebar Skip to footer

Blank Option Text Using $(dropdown).append(new Option("joe Blow", 1, True, True) In Ie 9

The following code works correctly in both Chrome and Firefox. In IE 9 the options are appended, but the Text is always blank. function populateDeveloperDropDownViaSkillProfile

Solution 1:

This could be related to a weird issue affecting past IE versions; to overcome it, I would try to force IE to update the option text after it has been appended:

if (v != undefined && v.Selected == true) {
    opt = newOption(v.Text, v.Value, true, true);
}
else {
    opt = newOption(v.Text, v.Value);
}

$(dropdown).append(opt);
$(opt).text(v.Text);

I don't know if this is the cause of your issue or not, but it is better to try.

Post a Comment for "Blank Option Text Using $(dropdown).append(new Option("joe Blow", 1, True, True) In Ie 9"