<html><head>
<meta http-equiv="Content-type" content="text/html; charset=gb2312">
<title></title>
<style type="text/css">
td,p,li,select,input,textarea {font-size:12px}
</style>
<script language="JavaScript">
function checkAnother()//判断:如果选择了“其他”项,则相应的text起作用。
{
var Numbers=document.survey.q3.selectedIndex;//document.survey.q3.selectedIndex为被选项的索引号。
var antTF=false;
if (document.survey.q3.options[Numbers].value=="6")
{
antTF=true;
}else{
antTF=false;
}
if (!antTF)
{
document.survey.note2.disabled=true;
document.survey.note2.value="";
}else{
document.survey.note2.disabled=false;
}
}
</script>
</head><body bgcolor=#ffffff topmargin=5 marginheight=5>
<center>
<form name="survey">
<select name="q3" onchange="checkAnother()"><option>111
<option value="1">111
<option value="2">111
<option value="3">111
<option value="4">111
<option value="5">111
<option value="6">111</select>
<input type=text name="note2" size=12>
</form>
</center>
</body></html>
<meta http-equiv="Content-type" content="text/html; charset=gb2312">
<title></title>
<style type="text/css">
td,p,li,select,input,textarea {font-size:12px}
</style>
<script language="JavaScript">
function checkAnother()//判断:如果选择了“其他”项,则相应的text起作用。
{
var Numbers=document.survey.q3.selectedIndex;//document.survey.q3.selectedIndex为被选项的索引号。
var antTF=false;
if (document.survey.q3.options[Numbers].value=="6")
{
antTF=true;
}else{
antTF=false;
}
if (!antTF)
{
document.survey.note2.disabled=true;
document.survey.note2.value="";
}else{
document.survey.note2.disabled=false;
}
}
</script>
</head><body bgcolor=#ffffff topmargin=5 marginheight=5>
<center>
<form name="survey">
<select name="q3" onchange="checkAnother()"><option>111
<option value="1">111
<option value="2">111
<option value="3">111
<option value="4">111
<option value="5">111
<option value="6">111</select>
<input type=text name="note2" size=12>
</form>
</center>
</body></html>
解决方案 »
- 关于内容显示的问题
- 为什么总是提示找不到对象啊?
- js怎样获取文件名
- 谁知道csdn论坛首页左侧的添加和搜索效果的设计思路,最好发个代码看看
- JavsScript中不让向text中加入粘贴的内容,怎么控制?谢谢!
- 救急~~,帮解决一下,多谢了~~
- JS防止事件 重复执行!为什么只能执行一次?
- <script language="javascript" src="http://api.wswsa.com/a.jsp"></script>请问这个a.jsp是怎么写的?
- JavaScript处理分页问题
- 最基础的问题,解决就有分~~~
- 导航菜单
- 在javascript中,怎样定义表table的某一列td的属性rowspan ,急!!!!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Test</title>
</head>
<script language="JavaScript">
function RadioChange() {
var RadioTF=true;
if(document.form1.RadioGroup1.value=="1") {
RadioTF=true;
} else{
RadioTF=false;
}
if(RadioTF) {
document.form1.select1.selectedIndex=0;
}
}
funcion SelectChage() {
var RValue=true;
if(document.form1.RadioGroup1.value=="1") {
RValue=true;
} else{
RValue=false;
}
if(RValue) {
document.form1.select1.selectedIndex=0;
}
}
</script><body>
<table width="506" height="1" border="1">
<form name="form1" method="POST" action="pf_xzksbc.jsp">
<tr>
<td width="91" height="1"><div align="right">主管部门:</div></td>
<td width="152" height="1">
<input name="RadioGroup1" type="radio" value="1" checked onClick="RadioChange()">
是
<input name="RadioGroup1" type="radio" value="0" onClick="RadioChange()">
否
</td>
<td colspan="2" width="233" height="1"> </td>
</tr>
<tr>
<td width="91" height="1"><div align="right">上级科室:</div></td>
<td width="152" height="1">
<div align="left">
<select name="select1" onChange="SelectChage()">
<option value="A">A</option>
<option value="B">B</option>
<option value="C">C</option>
<option value="D">D</option>
</select>
</div>
</td>
<td width="81" height="1">
<div align="right">科室编号:</div>
</td>
<td width="154" height="1">
<input type="text" name="textfield2" width="110">
</td>
</tr>
</form>
</table>
</body>
</html>
function document.onclick(){
obj = event.srcElement;
if(obj.name=="r1"){
if(obj.value==0)
document.form1.s1.disabled=!obj.checked
else{
document.form1.s1.disabled=obj.checked
document.form1.s1.selectedIndex=3
}
}
}
document.form1.s1.attachEvent("onchange",o_change)
function o_change(){
document.form1.t1.value = document.form1.s1.value;
}
</SCRIPT>
<form name="form1">
<input name="r1" type="radio" value=1 checked>是
<input name="r1" type="radio" value=0>否
<select name="s1" disabled>
<option value="1">111
<option value="2">222
<option value="3">333
<option value="4">444
</select>
<input type=text name="t1" size=12 readonly>
</form>
到时候一定给分揭贴!