Denne er nok tættere på :)
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="content-type" content="text/html; charset=iso-8859-1"><title>Ingen titel</title>
<style type="text/css">
#amountid {width:50px;}
</style>
<script type="text/javascript">
var chkscales = {"Timer":[3,24],"Dage":[1,31],"Måneder":[1,12]};
function chkscale(e){
var evalue=e[e.selectedIndex].firstChild.nodeValue;
var a=e.form.amount;
if(evalue=="Vælg"){
a.disabled=true;
a.style.display="inline"; // ved ikke om denne ikke er ønsket
}else if(evalue=="Permanent"){
a.disabled=true;
a.style.display="none"; // ved ikke om denne ikke er ønsket
}else{
a.disabled=false;
a.style.display="inline"; // ved ikke om denne ikke er ønsket
for(i=0,j=a.childNodes.length;i<j;i++)a.removeChild(a.firstChild);
for(i=chkscales[evalue][0],j=chkscales[evalue][1];i<=j;i++){
var b=document.createElement("option");
b.appendChild(document.createTextNode(i));
a.appendChild(b);
}
}
}
function chksub(f){
var e=f.scale;
if(e[e.selectedIndex].firstChild.nodeValue=="Permanent"||!f.amount.disabled)return true;
else{
alert("Vælg ban type og tid");
return false;
}
}
</script>
</head><body>
<form method="get" action="1.html" name="formnavn" onsubmit="return chksub(this);">
Ban: <select name="amount" id="amountid" disabled="disabled"><option> </option></select><select name="scale" onchange="chkscale(this);"><option>Vælg</option><option>Timer</option><option>Dage</option><option>Måneder</option><option>Permanent</option></select>
<input type="submit" value="Ban fjolset">
</form>
</body></html>