function Check(){
var rbt=document.getElementsByName("rbt");
for(i=0;i<rbt.length;i++){
if (rbt[i].checked){
return true;
}
}
alert("please select!");
return false;
}
</script>
<body>
<form name="myform" method="post" action="123.asp" onSubmit="return Check()">
  <input type="radio" name="rbt" value="0">
  <input type="radio" name="rbt" value="1">
  <input type="radio" name="rbt" value="2">
  <input type="radio" name="rbt" value="3">
  <input type="submit">
</form>

解决方案 »

  1.   

    同意楼上的观点
    function Check(){
    var rbt=document.myform.Grbt.value;
    for(rbt == ''){
                     alert("please select!");
            return false;
    }

    }
    </script>
    <body>
    <form name="myform" method="post" action="123.asp" onSubmit="return Check()">
      <input type="radio" name="rbt" value="0" onclick="document.myform.Grbt.value=this.value">
      <input type="radio" name="rbt" value="1" onclick="document.myform.Grbt.value=this.value">
      <input type="radio" name="rbt" value="2" onclick="document.myform.Grbt.value=this.value">
      <input type="radio" name="rbt" value="3" onclick="document.myform.Grbt.value=this.value">
      <input type="submit">
    <input type="hidden" name="Grbt" value="">
    </form>