我的一段javascript语句在某些机器上失效,高分请教!!

jians 2003-08-19 05:16:53
<html>
<script language="JavaScript">
function onOkBtnClick(Form)
{

var iFuncType = Form.FuncType.value;

if (iFuncType != "Cancel" && iFuncType != "Apply")
{
alert("请选择功能");
return false;
}

body.style.cursor='wait';

Form.submit();
return true;
}


function SetCancelType(Form)
{
Form.FuncType.value = "Cancel";
}

function SetApplyType(Form)
{
Form.FuncType.value = "Apply";
}
</script>
<body>
<form name="SelectFunctionForm">
<input type="radio" value="Apply" name="FuncType" OnClick="SetApplyType(SelectFunctionForm)">申请功能   
<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>

以上是大概的语句,在绝大部分机器都没有问题,但在某些机器上我选择了
其中任一个radio button,仍然报“请选择功能”,也就是说radio button
的onClick没有起效果。为什么呢,有什么IE的设置会造成该问题?
...全文
118 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
fason 2003-08-19
  • 打赏
  • 举报
回复
<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">申请功能   
<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>
fason 2003-08-19
  • 打赏
  • 举报
回复
验证是否选择两个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">申请功能   
<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>
jians 2003-08-19
  • 打赏
  • 举报
回复
to kingdomzhf:
这样改和原来不是一样吗?有什么不同啊?
kingdomzhf 2003-08-19
  • 打赏
  • 举报
回复
<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)">申请功能   
<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>
jians 2003-08-19
  • 打赏
  • 举报
回复
请各位大侠帮帮忙!!谢谢啦

87,904

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧