<form name="form1" onsubmit="return foo()">
<input type="radio" name="radiogroup1">
<input type="radio" name="radiogroup1">
<input type="radio" name="radiogroup1">
<input type="radio" name="radiogroup1">
<input type="radio" name="radiogroup1">
<input type="radio" name="radiogroup1">
<input type="submit">
</form>
<script>
function foo(){
for(i=0;i<document.form1.radiogroup1.length;i++)
{
if (document.form1.radiogroup1[i].checked){
alert(i);
return i;
}
}
return false;
}
</script>