<html>
<script language="JavaScript">
    function onOkBtnClick(oForm)
    {       

var iFuncType = oForm.FuncType.value;

if (iFuncType != "Cancel"  && iFuncType != "Apply")
{
    alert("请选择功能");
    return false;
}
        
                  body.style.cursor='wait'; oForm.submit();
                  return true;
    }
    
    
    function SetCancelType(oForm)
    {
        oForm.FuncType.value = "Cancel";       
    }
        
    function SetApplyType(oForm)
    {
        oForm.FuncType.value = "Apply";
    }
</script>
<body>
<form name="SelectFunctionForm">
      <input type="radio" value="Apply"   name="FuncType" OnClick="SetApplyType(SelectFunctionForm)">申请功能&nbsp;&nbsp;&nbsp; 
      <input type="radio" value="Cancel"  name="FuncType" OnClick="SetCancelType(SelectFunctionForm)">取消功能
<img border="0" onclick="onOkBtnClick(SelectFunctionForm)" src="image/button_queding.gif" width="68" height="22">
</form>
</body>
</html>

解决方案 »

  1.   

    to kingdomzhf:
       这样改和原来不是一样吗?有什么不同啊?
      

  2.   

    验证是否选择两个onclick是多余的
    <html>
    <script language="JavaScript">
        function onOkBtnClick(Form){       
    var iFuncType = Form.FuncType;
    for(i=0;i<iFuncType.length;i++)if(iFuncType[i].checked)return true
    alert("请选择功能");
    return false;
    /*
            document.body.style.cursor='wait';
            return true;这也是没有意议,提交了来个wait还看得到?
    */
        }
    </script>
    <body>
    <form name="SelectFunctionForm" target="_blank" action="a.asp">
          <input type="radio" value="Apply"   name="FuncType">申请功能&nbsp;&nbsp;&nbsp; 
          <input type="radio" value="Cancel"  name="FuncType">取消功能
    <input type=submit onclick="return onOkBtnClick(SelectFunctionForm)" src="image/button_queding.gif" width="68" height="22">
    </form>
    </body>
    </html>
      

  3.   

    <html>
    <script language="JavaScript">
        function onOkBtnClick(Form){       
    var iFuncType = Form.FuncType;
    for(i=0;i<iFuncType.length;i++)if(iFuncType[i].checked)return true
    alert("请选择功能");
    return false;
    /*
            document.body.style.cursor='wait';
            return true;这也是没有意议,提交了来个wait还看得到?
    */
        }
    </script>
    <body>
    <form name="SelectFunctionForm">
          <input type="radio" value="Apply"   name="FuncType">申请功能&nbsp;&nbsp;&nbsp; 
          <input type="radio" value="Cancel"  name="FuncType">取消功能
    <input type=image onclick="return onOkBtnClick(SelectFunctionForm)" src="image/button_queding.gif" width="68" height="22">
    </form>
    </body>
    </html>