Puoi anche fare cosi....
codice:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<script language="JavaScript" type="text/javascript">
<!--
function controlla() {
var anObj = document.getElementById('form1');
len = anObj.children.length;
for (i=0;i<len;i++) {
curObj = anObj.children(i);
if (curObj.tagName == 'INPUT' && curObj.type == 'radio' && curObj.name == 'r1') {
if (curObj.checked) {
return true;
} // if (curObj.checked)
} // if (curObj.tagName == 'INPUT' && curObj.type == 'radio' && curObj.name == 'r1')
} // for (i=0;i<len;i++)
alert('devi fare una selezione');
return false;
} // function controlla()
//-->
</script>
</head>
<body>
<form id="form1" onsubmit="return controlla()">
<input type="radio" name="r1" value="primo">Primo
<input type="radio" name="r1" value="secondo">Secondo
<input type="radio" name="r1" value="terzo">Terzo
<input type="radio" name="r1" value="quarto">Quarto
<input type="submit" value="Controlla" >
</form>
</body>
</html>