function isValid()
{
f = document.indict;
checked = false;
for(c=0; c<f.situation.length; c++)
{
if(f.situation[c].checked) checked=true;
}
if(!checked) alert("请选择");
return checked;
}
{
f = document.indict;
checked = false;
for(c=0; c<f.situation.length; c++)
{
if(f.situation[c].checked) checked=true;
}
if(!checked) alert("请选择");
return checked;
}
2.wasuka(喋喋不休的食尸鬼) ( )给出的代码已经给你返回了一个值,你需要再次判断,然后决定是否执行
form1.action="doindict.jsp?mode=new";
form1.target = "main";
form1.submit();
function isValid() {
var myf=document.forms[0];
for(var i=0;i<myf.situation.length;i++){
if(myf.situation[i].checked){
return true;//RADIO有一个被选择了
}
}
alert("请选择已完成/未完成!"); //没有选择
return false;
}
</script>