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>
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>
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>