JSP 多条件查询~
<TABLE id=table89 width= "100% " bgColor=#EDEEEE border=0 class= "font_black ">
<TBODY>
<TR>
<TD align=left width=750
bgColor=#EDEEEE colspan= "2 "> <font color= "#000080 ">
<input type= "checkbox " value= "ON " name= "manage " id= "manage0 " onClick= "selectexamine(); "> </font> 审批 </TD>
</TR>
<TR>
<TD align=right width= "23% "
bgColor=#EDEEEE> <font color= "#000080 ">
<input type= "checkbox " value= "ON " id= "SYSLEVELxmjys-T_MANAGE_PRECESS_INFO-check " name= "manage ">
</font> 项目建议书: </TD>
<TD width= "528 " bgColor=#EDEEEE align= "left ">
<select size= "1 " id= "SYSLEVELxmjys-T_MANAGE_PRECESS_INFO-list " name= "项目建议书 ">
<option> -- 请选择 -- </option>
<option value= "comany "> 批准单位 </option>
<option value= "number "> 批准文号 </option>
<option value= "title "> 批准文号标题 </option>
<option value= "audit_date "> 审批日期 </option>
<option value= "comment "> 备注 </option>
</select>
<input type= "text " id= "SYSLEVELxmjys-T_MANAGE_PRECESS_INFO.select_level-txt " name= "T1 " size= "17 "> </TD>
</TR>
<TR>
<TD align=right width= "23% "
bgColor=#EDEEEE> <font color= "#000080 ">
<input type= "checkbox " value= "ON " id= "SYSLEVELkybg-T_MANAGE_PRECESS_INFO.select_level-check " name= "manage ">
</font> 可研报告: </TD>
<TD width= "528 " bgColor=#EDEEEE align= "left "> <select size= "1 " id= "SYSLEVELkybg-T_MANAGE_PRECESS_INFO-list " name= "可研报告 ">
<option> -- 请选择 -- </option>
<option value= "comany "> 批准单位 </option>
<option value= "number "> 批准文号 </option>
<option value= "title "> 批准文号标题 </option>
<option value= "audit_date "> 审批日期 </option>
<option value= "comment "> 备注 </option>
</select>
<input type= "text " id= "SYSLEVELkybg-T_MANAGE_PRECESS_INFO-txt " name= "T2 " size= "17 "> </TD>
</TR>
<TR>
<TD align=right bgColor=#EDEEEE> <font color= "#000080 ">
<input type= "checkbox " value= "ON " id= "SYSLEVELcsbg-T_MANAGE_PRECESS_INFO-check " name= "manage ">
</font> 初设报告: </TD>
<TD bgColor=#EDEEEE align= "left "> <select size= "1 " id= "SYSLEVELcsbg-T_MANAGE_PRECESS_INFO-list " name= "初设报告 ">
<option> -- 请选择 -- </option>
<option value= "comany "> 批准单位 </option>
<option value= "number "> 批准文号 </option>
<option value= "title "> 批准文号标题 </option>
<option value= "audit_date "> 审批日期 </option>
<option value= "comment "> 备注 </option>
</select>
<input type= "text " id= "SYSLEVELcsbg-T_MANAGE_PRECESS_INFO-txt " name= "T3 " size= "17 "> </TD>
</TR>
<TR>
<TD align=right width= "23% " bgColor=#EDEEEE> <font color= "#000080 ">
<input type= "checkbox " value= "ON " id= "SYSLEVELkgbg-T_MANAGE_PRECESS_INFO-check " name= "manage ">
</font> 开工报告: </TD>
<TD width=528 bgColor=#EDEEEE align= "left "> <select size= "1 " id= "SYSLEVELkgbg-T_MANAGE_PRECESS_INFO-list " name= "开工报告 ">
<option> -- 请选择 -- </option>
<option value= "comany "> 批准单位 </option>
<option value= "number "> 批准文号 </option>
<option value= "title "> 批准文号标题 </option>
<option value= "audit_date "> 审批日期 </option>
<option value= "comment "> 备注 </option>
</select>
<input type= "text " id= "SYSLEVELkgbg-T_MANAGE_PRECESS_INFO-txt " name= "T4 " size= "17 "> </TD>
</TR>
<TR>
<TD align=left width=750 bgColor=#EDEEEE colspan= "2 "> 核准 </TD>
</TR>
<TR>
<TD width= "23% " bgColor=#EDEEEE align= "right "> <font color= "#000080 ">
<input type= "checkbox " value= "ON " id= "SYSLEVEL-T_MANAGE_PRECESS.audit_dep_level-check " name= "manage ">
</font> 核准部门级别: </TD>
<TD width= "528 " bgColor=#EDEEEE align= "left "> <select size= "1 " id= "SYSLEVEL-T_MANAGE_PRECESS.audit_dep_level-list " name= "auditDepLevel ">
<option> -- 请选择 -- </option>
<option value= "国家 "> 国家 </option>
<option value= "省级 "> 省级 </option>
<option value= "市级 "> 市级 </option>
<option value= "县级 "> 县级 </option>
</select>
<input type= "text " id= "SYSLEVEL-T_MANAGE_PRECESS.audit_dep_level-txt " name= "T34 " size= "17 "> </TD> </TR>
<TR>
<TD width=750 bgColor=#EDEEEE align= "left " colspan= "2 "> 备案 </TD>
</TR>
<TR>
<TD width= "23% " bgColor=#EDEEEE align= "right "> <font color= "#000080 ">
<input type= "checkbox " value= "ON " id= "SYSLEVELbawj-T_MANAGE_PRECESS_INFO-check " name= "manage ">
</font> 备案文件情况: </TD>
<TD width=528 bgColor=#EDEEEE align= "left "> <select size= "1 " id= "SYSLEVELbawj-T_MANAGE_PRECESS_INFO-list " name= "备案文件情况 ">
<option> -- 请选择 -- </option>
<option value= "comany "> 受理单位 </option>
<option value= "number "> 备案文号 </option>
<option value= "audit_date "> 备案时间 </option>
<option value= "comment "> 备注 </option>
</select>
<input type= "text " id= "SYSLEVELbawj-T_MANAGE_PRECESS_INFO-txt " name= "T35 " size= "17 "> </TD> </TR>
</TBODY> </TABLE>
这是表单~~~
我现在想在后台的JSP页面 获取 复选框的值
要怎么样才能获取过来~~~ 急用!~~
[解决办法]
request.getParameterValues();
[解决办法]
不提交 这个页面 获取? 那不是要用到AJAX。。。。。
正常的话 设置一个from 提交给一个Servlet 或JSP页 下个Servlet 和jsp 调用
request.getParameter( " ")《——对应这个页面的name就行了 。。name= "开工报告 "。。
好象不能用中文的
这真是JSP基础中的基础如果这你是确实不会那真的需要买本相关的书好好看看啦
[解决办法]
String S1=request.getParameter( "name1 ");
String S2=request.getParameter( "name2 ");
String S3=request.getParameter( "name3 ");
String S4=request.getParameter( "name4 ");
String SQL= "select * from table " ;
if (S1.equals( " ")){
}
else {
SQL=SQL+ " and S1like '% " + S1+ "% ' ";
}
if (S2.equals( " ")){
}
else {
SQL=SQL+ " and S2 like '% " + S2+ "% ' ";
}
if (S3.equals( " ")){
}
else {
SQL=SQL+ " and S3 like '% " + S3+ "% ' ";
}
if (S4.equals( " ")){
}
else {
SQL=SQL+ " and S4 like '% " + S4+ "% ' ";
}
是这样吗?