aller simpleste løsning:
<html>
<head>
<title>Untitled</title>
</head>
<body>
<script language=\"JavaScript\">
function updateselect(){
var f1 = document.minform.f1.value;
var f2 = document.minform.f2.value;
var f3 = document.minform.f3.value;
var f4 = document.minform.f4.value;
document.minform.selectlist.options[ document.minform.selectlist.options.length] = new Option( f1, f1 );
document.minform.selectlist.options[ document.minform.selectlist.options.length] = new Option( f2, f2 );
document.minform.selectlist.options[ document.minform.selectlist.options.length] = new Option( f3, f3 );
document.minform.selectlist.options[ document.minform.selectlist.options.length] = new Option( f4, f4 );
}
</script>
<form name = \"minform\">
<input type = \"text\" name = \"f1\" size = 10><br>
<input type = \"text\" name = \"f2\" size = 10><br>
<input type = \"text\" name = \"f3\" size = 10><br>
<input type = \"text\" name = \"f4\" size = 10><br><br>
<input type = \"button\" value = \"Opdater Select (LOV)\" onclick = \"java script:updateselect();\"><br><br>
<select name=\"selectlist\" style=\"float: right; width: 150; position: absolute\" size=\"1\">
<option value=\"1\">valg 1</option>
</select>
</form>
</body>
</html>
Nute>> Det virker jo fint. Det skal være sådan at eksisterende options bliver slettet først!
så skal du bare legge inn denne linje som første linje i din \'updateselect\' funksjon:
document.minform.selectlist.options.length = 0;
/nute