Her er så en løsning med god hjælp fra fritz-79th ;-)
<html>
<head>
<script language="javascript">
function validateForm(){
var d = document.forms['form'];
var radio = d.radioknap;
var checked = false;
var text = d.tekst;
var i;
for(i=0; i<radio.length; i++){
if(radio[i].checked){
checked = true;
}
}
if(!checked){
alert('vælg venligst en radiobutton');
return false;
}
if(text.value == ''){
alert('udfyld venligst tekstfeltet');
text.focus();
return false;
}
}
</script>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form name="form" action="
http://www.eksperten.dk">1<input type="radio" name="radioknap"><br>
2<input type="radio" name="radioknap"><br>
3<input type="radio" name="radioknap"><br>
4<input type="radio" name="radioknap"><br>
Teksteksempel:<input type="Text" name="tekst"><br>
<input name="afsend" type="submit" onClick="return validateForm();">
</form>
</body>
</html>