<select size="1" name="id">
                        <option value="1" <%=(id==1)?"selected":""%>>aaaa</option>
                        <option value="0" <%=(id==0)?"selected":""%>>bbbb</option>
                      </select>
你试试!

解决方案 »

  1.   

    <select onchange="SetSomething(this.value);" ...然后你可以在SetSomething(v)这个函数里根据v去改变你要改变的东西参考js和DHTML等~```````
      

  2.   

    to:yiyioo(天一(日啃一文,月习一类,不求通透,只求半解)) ===========================
    <select name="template_id" style="width:120px">
                      <option value="0" style='color:#3300FF'>=请选择模板=</option>
                          <%
                             Vector vct =new Vector();
                             vct = tmp.getTmpList();
                              for(int i=0;i<vct.size();i++)
                              {
                                  TransferTemplate temp = (TransferTemplate)vct.get(i);
                           %>
                          <option value="<%=temp.getTemplate_id()%>" style='color:#3300FF'><%=temp.getTemplate_name()%></option>
                          <%}%>
                        </select> </td>
                    </tr>
    <tr>
      <td height="25" width="112" align="right"><font color="#CC0000">附  件:</font></td>
    <td>
                    <input type="hidden" name="sAffixIDs"  value="" >
                    <iframe frameborder="0" width="600" id="affix" name="affix" src="../include/jsp/AffixFrame.jsp">
    </iframe>
    </td>
    </tr>
                    <tr>
                      <td height="30" width="112" align="right"><font color="#CC0000">文件内容:</font></td>
                      <td width="849" >
                    <%
    //                    String template_id = request.getParameter("template_id");
    //                    System.out.println(template_id);
    //                    if(template_id!=null && !template_id.equals(""))
    //                    {
                    %>
                     <img src="../images/enter1.gif" border=0 title="点击进入Word模版编辑" onClick="editInWord(<%=template_id%>)" style="cursor:hand" edit="word">                <%//}else{%>
                       <img src="../images/new1.gif" border=0 title="点击新建Word" onClick="newInWord()" style="cursor:hand" edit="word">                <%//}%>
    ========================================如果模板选择的值为0,就显示new1.gif,否则就显示enter1.gif