master
dsh 1 year ago
parent ddbb5355f4
commit edda01981e

@ -26,21 +26,21 @@ function createHttpRequest() {
function buildOptions(xmlDoc,id) {
var selectObj = document.getElementById(id);
if (!selectObj || selectObj.tagName!="TR") {
if (!selectObj || selectObj.tagName!="SELECT") {
return;
}
var options = xmlDoc.getElementsByTagName("option");
//clear select object
for (var i = selectObj.length-1 ; i >= 0 ; i--){
selectObj.options[i] = null;
}
// for (var i = selectObj.length-1 ; i >= 0 ; i--){
// selectObj.options[i] = null;
// }
selectObj.length = 0;
for (var i=0; i<options.length; i++) {
var len = selectObj.length;
selectObj.length = len + 1;
selectObj.options[len].value = options[i].getAttribute("value");
selectObj.options[len].text = options[i].getAttribute("text");
if (options[i].getAttribute("selected") =="selected") {
selectObj.options[len].value = options[i].attributes[0].nodeValue;
selectObj.options[len].text = options[i].attributes[1].nodeValue;
if (options[i].attributes[2].nodeValue =="selected") {
selectObj.options[len].selected = true;
}
}

Loading…
Cancel
Save