The following code works perfectly in non-IE browsers. Please note that these first three options were added via jQuery.
<select id="mySelect" name="mySelect">
<option value="1">MyVal1</option>
<option value="2">MyVal2</option>
<option value="3">MyVal3</option>
</select>
I clear out the options so I can add new ones:
// my new values has the proper values of [{"Id": 4, "Text" : "MyVal4"}, {"Id": 5, "Text": "MyVal5"}]
$("#mySelect").empty();
for (var i = 0; i < myNewVals.length; i++) {
$("#mySelect").append('<option value="' + myNewVals[i].Id + '">' + myNewVals[i].Text + '</option');
}
It works the first time I try to populate it, but then every subsequent time thereafter, it repopulates the dropdown with the same values. Why does it ignore the new values when attempting to remake the options?