<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>

解决方案 »

  1.   

    谢谢楼上的!!! 我模仿你的自己写那下,可老是提示Javascript错误,能不能帮我检查下!
    <!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">&nbsp;&nbsp;</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>
      

  2.   

    funcion SelectChage() 少了一个t应该是function
      

  3.   

    <SCRIPT LANGUAGE="JavaScript" defer>
      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>
      

  4.   

    谢谢上面那位仁兄!小子正在理解ing...
    到时候一定给分揭贴!