<SCRIPT LANGUAGE="JavaScript">
<!--
function checkSelectType(){ if(themeAdd.txt_h_t_type.options[themeAdd.txt_h_t_type.selectedIndex].value == '单选题'){
selectAnswerU.style.display = "";
selectAnswerM.style.display = "NONE";
otherAnswer.style.dispaly = "NONE";
}else if(themeAdd.txt_h_t_type.options[themeAdd.txt_h_t_type.selectedIndex].value == '多选题'){
selectAnswerU.style.display = "NONE";
selectAnswerM.style.display = "";
otherAnswer.style.dispaly = "NONE";
}else if(themeAdd.txt_h_t_type.options[themeAdd.txt_h_t_type.selectedIndex].value == '判断题'){
///alert(themeAdd.txt_h_t_type.options[themeAdd.txt_h_t_type.selectedIndex].value);
otherAnswer.style.display = ""; /////////////////////写错display了
selectAnswerU.style.display = "none";
selectAnswerM.style.display = "none";
}

}
//-->
</SCRIPT>
<table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="26CD15">
              <FORM METHOD=POST ACTION="" name="themeAdd" onSubmit="checkValue();">
                <tr bgcolor="#ADF5A5"> 
                  <td height="22"  colspan="8" align="center" bgcolor="#ADF5A5">添加试题</td>
                </tr>
                <tr bgcolor="#FFFFFF"> 
                  <td width="60" height="22" align="center">科  目</td>
                  <td width="120" height="22"> <select name="txt_h_t_s_name" class="txt">
                      <!-- BEGIN subject_list -->
                      <option value="{h_t_s_name}">{h_t_s_name}</option>
                      <!-- END subject_list -->
                    </select> </td>
                  <td width="60" align="center">分值</td>
                  <td width="40" align="center"> <input name="txt_h_t_score" type="text" class="txt" size="3" maxlength="3"> 
                  </td>
                  <td width="60" align="center">类型</td>
                  <td width="80"> <select name="txt_h_t_type" class="txt" onChange="checkSelectType();">
                      <option value="">选择类型</option>
                      <option value="单选题">单选题</option>
                      <option value="多选题">多选题</option>
                      <option value="判断题">判断题</option>
                      <option value="填空题">填空题</option>
                      <option value="简答题">简答题</option>
                      <option value="论述题">论述题</option>
                    </select> </td>
                  <td width="40" align="center">难度</td>
                  <td align="center"> <input name="txt_h_t_difficulty" type="text" class="txt" size="3" maxlength="3"> 
                  </td>
                </tr>
                <tr bgcolor="#FFFFFF"> 
                  <td align="center">题干内容</td>
                  <td colspan="7"><textarea name="txt_h_t_name" cols="80" rows="5" class="txt"></textarea> 
                  </td>
                </tr>
                <tr bgcolor="#FFFFFF" class="hight" id="selectAnswerU" style="display: NONE"> 
                  <td height="10" align="center">备 选 项<br> <table width="98%" border="0" cellspacing="0" cellpadding="0">
                      <tr> 
                        <td height="24" align="center"> <input name="addOption" type="button" class="btn" value="增加"> 
                        </td>
                      </tr>
                      <tr> 
                        <td height="24" align="center"> <input name="disOption" type="button" class="btn" value="减少"> 
                        </td>
                      </tr>
                    </table></td>
                  <td height="10" colspan="7" valign="top"> 
                    <input type="radio" name="txt_h_t_answer_u" value=""> 
                    <input name="txt_h_t_answer_unity[]" type="text" class="txt" size="78">
                  </td>
                </tr>
                <tr bgcolor="#FFFFFF" class="hight" id="selectAnswerM" style="display: NONE">
                  <td height="11" align="center">备 选 项<br> <table width="98%" border="0" cellspacing="0" cellpadding="0">
                      <tr> 
                        <td height="24" align="center"> <input name="addOption2" type="button" class="btn" value="增加"> 
                        </td>
                      </tr>
                      <tr> 
                        <td height="24" align="center"> <input name="disOption2" type="button" class="btn" value="减少"> 
                        </td>
                      </tr>
                    </table></td>
                  <td height="11" colspan="7" valign="top"><input type="checkbox" name="txt_h_t_answer_m[]" value="checkbox"> 
                    <input name="txt_h_t_answer_multi[]" type="text" class="txt" size="78">
                  </td>
                </tr>
                <tr bgcolor="#FFFFFF" id="otherAnswer" style="display: NONE"> 
                  <td height="22" align="center">标准答案</td>
                  <td height="22" colspan="7"><textarea name="txt_h_t_answer" cols="80" rows="4" class="txt"></textarea></td>
                </tr>
                <tr bgcolor="#FFFFFF"> 
                  <td height="22" align="center">图  片</td>
                  <td height="22" colspan="7"><input name="textfield422" type="text" class="txt" size="74"> 
                    <input name="Submit2" type="button" class="btn" value="上传"></td>
                </tr>
                <tr bgcolor="#FFFFFF"> 
                  <td height="22">&nbsp;</td>
                  <td height="22" colspan="7"><input name="Submit" type="submit" class="btn" value="确认添加试题"></td>
                </tr>
              </FORM>
            </table>

解决方案 »

  1.   

    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function checkSelectType(){ if(themeAdd.txt_h_t_type.options[themeAdd.txt_h_t_type.selectedIndex].value == '单选题'){
    selectAnswerU.style.display = "";
    selectAnswerM.style.display = "NONE";
    uu.style.dispaly = "NONE";
    }else if(themeAdd.txt_h_t_type.options[themeAdd.txt_h_t_type.selectedIndex].value == '多选题'){
    selectAnswerU.style.display = "NONE";
    selectAnswerM.style.display = "";
    uu.style.dispaly = "NONE";
    }else if(themeAdd.txt_h_t_type.options[themeAdd.txt_h_t_type.selectedIndex].value == '判断题'){
    selectAnswerU.style.display = "NONE";
    selectAnswerM.style.display = "NONE";
    uu.style.display=""


    }

    }
    //-->
    </SCRIPT>
    <table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="26CD15">
                  <FORM METHOD=POST ACTION="" name="themeAdd" onSubmit="checkValue();">
                    <tr bgcolor="#ADF5A5"> 
                      <td height="22"  colspan="8" align="center" bgcolor="#ADF5A5">添加试题</td>
                    </tr>
                    <tr bgcolor="#FFFFFF"> 
                      <td width="60" height="22" align="center">科  目</td>
                      <td width="120" height="22"> <select name="txt_h_t_s_name" class="txt">
                          <!-- BEGIN subject_list -->                        
                          <option value="{h_t_s_name}">{h_t_s_name}</option>
                          <!-- END subject_list -->
                        </select> </td>                        
                      <td width="60" align="center">分值</td>
                      <td width="40" align="center"> <input name="txt_h_t_score" type="text" class="txt" size="3" maxlength="3"> 
                      </td>
                      <td width="60" align="center">类型</td>
                      <td width="80"> <select name="txt_h_t_type" class="txt" onChange="checkSelectType();">
                          <option value="">选择类型</option>
                          <option value="单选题">单选题</option>
                          <option value="多选题">多选题</option>
                          <option value="判断题">判断题</option>
                          <option value="填空题">填空题</option>
                          <option value="简答题">简答题</option>
                          <option value="论述题">论述题</option>
                        </select> </td>
                      <td width="40" align="center">难度</td>
                      <td align="center"> <input name="txt_h_t_difficulty" type="text" class="txt" size="3" maxlength="3"> 
                      </td>
                    </tr>
                    <tr bgcolor="#FFFFFF"> 
                      <td align="center">题干内容</td>
                      <td colspan="7"><textarea name="txt_h_t_name" cols="80" rows="5" class="txt"></textarea> 
                      </td>
                    </tr>
                    <tr bgcolor="#FFFFFF" class="hight" id="selectAnswerU" style="display:NONE"> 
                      <td height="10" align="center">备 选 项<br> <table width="98%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td height="24" align="center"> <input name="addOption" type="button" class="btn" value="增加"> 
                            </td>
                          </tr>
                          <tr> 
                            <td height="24" align="center"> <input name="disOption" type="button" class="btn" value="减少"> 
                            </td>
                          </tr>
                        </table></td>
                      <td height="10" colspan="7" valign="top"> 
                        <input type="radio" name="txt_h_t_answer_u" value="display: NONE"> 
                        <input name="txt_h_t_answer_unity[]" type="text" class="txt" size="78">
                      </td>
                    </tr>
                    <tr bgcolor="#FFFFFF" class="hight" id="selectAnswerM" style="display: NONE">
                      <td height="11" align="center">备 选 项<br> <table width="98%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td height="24" align="center"> <input name="addOption2" type="button" class="btn" value="增加"> 
                            </td>
                          </tr>
                          <tr> 
                            <td height="24" align="center"> <input name="disOption2" type="button" class="btn" value="减少"> 
                            </td>
                          </tr>
                        </table></td>
                      <td height="11" colspan="7" valign="top"><input type="checkbox" name="txt_h_t_answer_m[]" value="checkbox"> 
                        <input name="txt_h_t_answer_multi[]" type="text" class="txt" size="78">
                      </td>
                    </tr>
                    <tr bgcolor="#FFFFFF" id="uu" style="display: NONE"> 
                      <td height="22" align="center">标准答案</td>
                      <td height="22" colspan="7"><textarea name="txt_h_t_answer" cols="80" rows="4" class="txt"></textarea></td>
                    </tr>
                    <tr bgcolor="#FFFFFF"> 
                      <td height="22" align="center">图  片</td>
                      <td height="22" colspan="7"><input name="textfield422" type="text" class="txt" size="74"> 
                        <input name="Submit2" type="button" class="btn" value="上传"></td>
                    </tr>
                    <tr bgcolor="#FFFFFF"> 
                      <td height="22">&nbsp;</td>
                      <td height="22" colspan="7"><input name="Submit" type="submit" class="btn" value="确认添加试题"></td>
                    </tr>
                  </FORM>
                </table>
      

  2.   

    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function checkSelectType(){ switch(themeAdd.txt_h_t_type.options[themeAdd.txt_h_t_type.selectedIndex].value)
    {
    case  "单选题":
    selectAnswerU.style.display = "";
    selectAnswerM.style.display = "NONE";
    otherAnswer.style.dispaly = "NONE";
    break;
    case "多选题":
    selectAnswerU.style.display = "NONE";
    selectAnswerM.style.display = "";
    otherAnswer.style.dispaly = "NONE";
    break;
    case "判断题":
    otherAnswer.style.display = "block";
    selectAnswerU.style.display = "NONE";
    selectAnswerM.style.display = "NONE";
    break;
    }
    }
    //-->
    </SCRIPT>
    <table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="26CD15">
                  <FORM METHOD=POST ACTION="" name="themeAdd" onSubmit="checkValue();">
                    <tr bgcolor="#ADF5A5"> 
                      <td height="22"  colspan="8" align="center" bgcolor="#ADF5A5">添加试题</td>
                    </tr>
                    <tr bgcolor="#FFFFFF"> 
                      <td width="60" height="22" align="center">科  目</td>
                      <td width="120" height="22"> <select name="txt_h_t_s_name" class="txt">
                          <!-- BEGIN subject_list -->
                          <option value="{h_t_s_name}">{h_t_s_name}</option>
                          <!-- END subject_list -->
                        </select> </td>
                      <td width="60" align="center">分值</td>
                      <td width="40" align="center"> <input name="txt_h_t_score" type="text" class="txt" size="3" maxlength="3"> 
                      </td>
                      <td width="60" align="center">类型</td>
                      <td width="80"> <select name="txt_h_t_type" class="txt" onChange="checkSelectType();">
                          <option value="">选择类型</option>
                          <option value="单选题">单选题</option>
                          <option value="多选题">多选题</option>
                          <option value="判断题">判断题</option>
                          <option value="填空题">填空题</option>
                          <option value="简答题">简答题</option>
                          <option value="论述题">论述题</option>
                        </select> </td>
                      <td width="40" align="center">难度</td>
                      <td align="center"> <input name="txt_h_t_difficulty" type="text" class="txt" size="3" maxlength="3"> 
                      </td>
                    </tr>
                    <tr bgcolor="#FFFFFF"> 
                      <td align="center">题干内容</td>
                      <td colspan="7"><textarea name="txt_h_t_name" cols="80" rows="5" class="txt"></textarea> 
                      </td>
                    </tr>
                    <tr bgcolor="#FFFFFF" class="hight" id="selectAnswerU" style="display: NONE"> 
                      <td height="10" align="center">备 选 项<br> <table width="98%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td height="24" align="center"> <input name="addOption" type="button" class="btn" value="增加"> 
                            </td>
                          </tr>
                          <tr> 
                            <td height="24" align="center"> <input name="disOption" type="button" class="btn" value="减少"> 
                            </td>
                          </tr>
                        </table></td>
                      <td height="10" colspan="7" valign="top"> 
                        <input type="radio" name="txt_h_t_answer_u" value=""> 
                        <input name="txt_h_t_answer_unity[]" type="text" class="txt" size="78">
                      </td>
                    </tr>
                    <tr bgcolor="#FFFFFF" class="hight" id="selectAnswerM" style="display: NONE">
                      <td height="11" align="center">备 选 项<br> <table width="98%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td height="24" align="center"> <input name="addOption2" type="button" class="btn" value="增加"> 
                            </td>
                          </tr>
                          <tr> 
                            <td height="24" align="center"> <input name="disOption2" type="button" class="btn" value="减少"> 
                            </td>
                          </tr>
                        </table></td>
                      <td height="11" colspan="7" valign="top"><input type="checkbox" name="txt_h_t_answer_m[]" value="checkbox"> 
                        <input name="txt_h_t_answer_multi[]" type="text" class="txt" size="78">
                      </td>
                    </tr>
                    <tr bgcolor="#FFFFFF" id="otherAnswer" style="display: NONE"> 
                      <td height="22" align="center">标准答案</td>
                      <td height="22" colspan="7"><textarea name="txt_h_t_answer" cols="80" rows="4" class="txt"></textarea></td>
                    </tr>
                    <tr bgcolor="#FFFFFF"> 
                      <td height="22" align="center">图  片</td>
                      <td height="22" colspan="7"><input name="textfield422" type="text" class="txt" size="74"> 
                        <input name="Submit2" type="button" class="btn" value="上传"></td>
                    </tr>
                    <tr bgcolor="#FFFFFF"> 
                      <td height="22"> </td>
                      <td height="22" colspan="7"><input name="Submit" type="submit" class="btn" value="确认添加试题"></td>
                    </tr>
                  </FORM>
                </table>