function getLocations(landID) { var orte = document.getElementsByName('orte'); var comboOrt = document.getElementById('comboOrt'); var defItem = document.getElementById('defItem'); var nodes = comboOrt.childNodes.length; for(var o = 0; o < nodes; o++) { comboOrt.removeChild(comboOrt.childNodes[0]); } comboOrt.appendChild(defItem); if(landID != 'none' && orte.length > 0) { comboOrt.disabled = false; for(var i = 0; i < orte.length; i++) { if(orte[i].value == landID) { var option = document.createElement('option'); if(orte[i].getAttribute('ortid') == '16') option.value = 'anderer'; else option.value = orte[i].getAttribute('ort'); if(orte[i].getAttribute('ortid') == "16") option.innerHTML = "<anderer>"; else option.innerHTML = orte[i].getAttribute('ort'); comboOrt.appendChild(option); } } } else { comboOrt.disabled = true; } }