路过的高手,帮我看看,这问题该如何解决
路过的高手,帮我看看,这问题该如何解决。我需要解决这样一个问题,后面一栏有考试情况,分为“正常”和“缺考”;
我想实现这样的效果:
当选择[color=DarkRed]正常[/color]时,前面输入成绩一栏为可以录入成绩,当选择[color=DarkRed]缺考[/color]时输入成绩[name:score ]一栏则变为不可用,防止在选择缺考的情况下再录入成绩
[attach]92926[/attach]
代码片断:
[color=DarkSlateBlue]<input type="text" name="score" size="4" value="<%=score%>" >
<select name="status" size="1">
<option value="正常" >正常</option>
<option value="缺考" >缺考</option>
</select>[/color] 不可用:
1.可以是隐藏
2.不可用disable(不知道打错了没有) 楼上的说得对,只是能具体到代码就好了
因为我不擅长写javascript脚本 [HTML]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="javascript">
<!--
function dispShow()
{
var set_value=document.form1.select1.value;
switch(set_value){
case "正常":
window.selectcheck.style.display="";
break;
case "缺考":
window.selectcheck.style.display="none";
break;
default:
window.selectcheck.style.display="";
}
}
-->
</script>
</head>
<body>
<table width="340" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><form name="form1" id="form1" method="post" action="">
<table width="340" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="140" height="25" align="right">考试情况:</td>
<td width="200" height="25">
<select name="select1" id="select1" onChange="dispShow()">
<option value="正常" selected>正常</option>
<option value="缺考">缺考</option>
</select></td>
</tr>
<tr>
<td height="25" align="right">信息:</td>
<td height="25">
<DIV id="selectcheck">
<select name="select2" id="select2">
<option value="A" >A</option>
<option value="B">B</option>
</select>
</div>
</td>
</tr>
</table>
</form></td>
</tr>
</table>
</body>
</html>[/HTML]
[[i] 本帖最后由 红心男孩 于 2008-7-1 15:43 编辑 [/i]] 楼上的,非常好,太感谢你了 现在写代码都要兼容性。火狐里一样可以评分
你是用后台程序生成的表格吧?在程序里检查,然后指定是否可以评分,更新的时候再次检查 后台管理平台的内容不需要考虑那么多人,IE就OK了。
页:
[1]