Hov glemte dobbelt focussering ...
<!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>
<script type="text/javascript">
function chkf(f){
o=[];
afsend=true;
focusf="";focusf2="";
if((!f.kon[0].checked)&&(!f.kon[1].checked)){
afsend=false;
if(focusf==""){focusf="konfelt";focusf2=f.kon[0];}
o[o.length]=f.kon[0];
}else f.kon[0].offsetParent.style.backgroundColor="#ffffff";
if(f.navn.value==""){
afsend=false;
if(focusf==""){focusf="navnfelt";focusf2=f.navn;}
o[o.length]=f.navn;
}else f.navn.offsetParent.style.backgroundColor="#ffffff";
if(!afsend){ // Hvis afsend er falsk så farv alle o objecters øvre objecter
for(i=0;i<o.length;i++)o[i].offsetParent.style.backgroundColor="#ffff00";
if(focusf!=""){
document.getElementById(focusf).focus();
focusf2.focus();
}
}
return afsend;
}
</script>
</head><body>
<form method="get" action="#" name="test" onsubmit="return chkf(this);">
<table border="0" width="100%" id="table1">
<tr>
<td><a href="#" id="konfelt"></a><b>Hvad er dit køn?</b></td>
</tr>
<tr>
<td><input type="radio" value="1" name="kon"> Kvinde
<input type="radio" value="2" name="kon">Mand</td>
</tr>
<tr>
<td><a href="#" id="navnfelt"></a><b>Hvad er dit navn?</b></td>
</tr>
<tr>
<td><input type="text" name="navn"></td>
</tr>
<tr>
<td><b>Hvad er din adresse?(behøver ikke udfyldes)</b></td>
</tr>
<tr>
<td><input type="text" name="adresse"></td></tr>
</table><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<input type="submit" name="submitter" value="afsend">
</form>
</body></html>