//想做的功能是:在点了单项按钮时,把下拉列表和复选框同时为禁用,请看什么地方有错
function validate(){ if(document.frmSub.radio.value=="no".checked){//如果点了单项按钮radio
document.frmSub.select.disabled;//下拉列表为禁用,但这里没有禁用?????????
for(var i=0;i<document.frmSub.elements.length;i++){//复选框为禁用,但这里没有禁用?????????
if(document.frmSub.elements[i].type=="checkbox"){
document.frmSub.elements[i].disabled;
}
}
}
}
function validate(){ if(document.frmSub.radio.value=="no".checked){//如果点了单项按钮radio
document.frmSub.select.disabled;//下拉列表为禁用,但这里没有禁用?????????
for(var i=0;i<document.frmSub.elements.length;i++){//复选框为禁用,但这里没有禁用?????????
if(document.frmSub.elements[i].type=="checkbox"){
document.frmSub.elements[i].disabled;
}
}
}
}
解决方案 »
- 跪求<<<<<<500分>>>>>>全送,MAXIMO 开发中文文档,在线等。。。。。
- Java语言,用MVC模式开发贪吃蛇游戏
- 隐藏跳转路径
- jsf中的问题 在线等!!急
- 我的用Tomcat5.0 怎么老是找不到页面
- 如何使用ORACLE的包,请进内详..
- 初学者想问一下什么是SWT?
- spring mvc框架中如何配置access数据库?
- Linux下Tomacat环境运行示例jsp粗出错,大家帮我看看.
- 怎样遍历一个表格或表单中的所有文本区?
- 关于JAVASCRIPT,在线考试的记时器,大哥大姐求助啊,我这个记时器为什么没显示啊!
- 重发:50! 关于 javabean 的 class 文件制作成 *.jar
你把var i; 定义在script的开头试试
document.frmSub.select.disabled="disabled";
for(var i=0;i<document.frmSub.elements.length;i++){
if(document.frmSub.elements[i].type=="checkbox"){
document.frmSub.elements[i].disabled="disabled";
}
}
}
}
document.frmSub.select.disabled="enabled"; if(document.frmSub.elements[i].type=="checkbox"){
document.frmSub.elements[i].disabled="enabled";
}
?????????????????????????
document.frmSub.select.disabled="";就是了
就是了