<SELECT style="WIDTH: 130px" name="select1">
<OPTION value="0" selected>支出</OPTION>
<OPTION value="2" >项目</OPTION>
<OPTION value="3">备选项目</OPTION>
<OPTION value="1" >收入</OPTION>
<OPTION value="4" >收费</OPTION>
<OPTION value="6" >人员</OPTION>
<OPTION value="7" >政府采购</OPTION>
<OPTION value="8" >单位信息</OPTION>
<OPTION value="5" >其他</OPTION>
</SELECT>String s = request.getParameter("select1") ;

解决方案 »

  1.   

    我以上代码是一个jsp还没传到下一个界面,在一个界面怎么用?
      

  2.   

    不知道为什么我取到的s 值为null,请kevinliuu(@。@)帮帮忙
      

  3.   

    如果在<select onchange="javascrip:submit()">怎么选择下面的下拉框不能改变值,还是默认的<支出〉
      

  4.   

    <select onchange="javascrip:submit()">
    <OPTION value="0" selected>支出</OPTION>是这个意思吗?  什么情况是你说的: 怎么选择下面的下拉框不能改变值,还是默认的<支出>没怎么看懂
      

  5.   

    我的问题解决了,与大家共享
    <%
    int newselect;
    %>
    <%
    String select =(String)request.getParameter("select1");
            try{         newselect=Integer.parseInt((String)request.getParameter("select1"));
            }catch(Exception e){
    newselect=0;
    }%><FORM name="form1" method="POST" action="shezhi.jsp">
    <fieldset class="width:200px" >    类型:
        <SELECT style="WIDTH: 130px" name="select1" onchange="javascrip:submit()" >
            <OPTION value="0" <%if(newselect==0)out.print("selected");%>>支出</OPTION>
            <OPTION value="1" <%if(newselect==1)out.print("selected");%>>收入</OPTION>
            <OPTION value="2" <%if(newselect==2)out.print("selected");%>>项目</OPTION>
            <OPTION value="3" <%if(newselect==3)out.print("selected");%>>备选</OPTION>
            <OPTION value="4" <%if(newselect==4)out.print("selected");%>>收费</OPTION>
            <OPTION value="5" <%if(newselect==5)out.print("selected");%>>其他</OPTION>
            <OPTION value="6" <%if(newselect==6)out.print("selected");%>>人员</OPTION>
            <OPTION value="7" <%if(newselect==7)out.print("selected");%>>政府</OPTION>
            <OPTION value="8" <%if(newselect==8)out.print("selected");%>>单位</OPTION>        </SELECT>
            <p>   <select style="width:200px;height:200px" size="9" name="select2">    <%    String type=(String)request.getParameter("select1");
        if(type==null){
          type="0";
        }
        String sql ="select name from bbpam where type='"+type+"' and fieldname='main'";
        //执行sql 语句 res=Select(sql);
        java.util.ArrayList res=con.m_resultList;
           for(int i = 0 ; i<res.size();i++){
                String aaa=(String)res.get("NAME");
             %>
             <option value="<%=i%>" ><%=aaa%></option>
            <p>
             <%
           }
        %>
        </select>