主题:如何使用checkbox(测试用例2)
用例2:checkbox_ok.jsp
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!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>无标题文档</title>
<style type="text/css">
<!--
.style3 {font-size: 12px}
-->
</style>
</head>
<body>
<% String[] picked=request.getParameterValues("selectx");
String cond="";
int i;
String filter1,filter2,filter3,filter4,filter5,filter6,filter7,filter8,filter9,filter10;
String use_id,use_name,use_pho,use_count,work_name,qd_name,use_con,use_jrlx,use_add,reg_time;
if (picked != null)
{
for (i = 0;i < picked.length; i++)
{
if(i==0&&picked[i].equals("1"))
{
use_id=request.getParameter("use_id");
filter1=request.getParameter("filter1");
cond=filter1+" "+use_id;
//out.println(cond);
//out.println("<br>");
//out.println(picked[i]);
}
if(i==1&&picked[i].equals("2"))
{
use_name=request.getParameter("use_name");
filter2=request.getParameter("filter2");
cond=cond+" "+filter2+" "+use_name;
//out.println(cond);
//out.println("<br>");
//out.println(picked[i]);
}
if(i==2&&picked[i].equals("3"))
{
use_pho=request.getParameter("use_pho");
filter3=request.getParameter("filter3");
cond=cond+" "+filter3+" "+use_pho;
//out.println(cond);
//out.println("<br>");
//out.println(picked[i]);
}
if(i==3&&picked[i].equals("4"))
{
use_count=request.getParameter("use_count");
filter4=request.getParameter("filter4");
cond=cond+" "+filter4+" "+use_count;
//out.println(cond);
//out.println("<br>");
//out.println(picked[i]);
}
if(i==4&&picked[i].equals("5"))
{
work_name=request.getParameter("work_name");
filter5=request.getParameter("filter5");
cond=cond+" "+filter5+" "+work_name;
//out.println(cond);
//out.println("<br>");
//out.println(picked[i]);
}
if(i==5&&picked[i].equals("6"))
{
qd_name=request.getParameter("qd_name");
filter6=request.getParameter("filter6");
cond=cond+" "+filter6+" "+qd_name;
//out.println(cond);
//out.println("<br>");
//out.println(picked[i]);
}
if(i==6&&picked[i].equals("7"))
{
use_con=request.getParameter("use_con");
filter7=request.getParameter("filter7");
cond=cond+" "+filter7+" "+use_con;
//out.println(cond);
//out.println("<br>");
//out.println(picked[i]);
}
if(i==7&&picked[i].equals("8"))
{
use_jrlx=request.getParameter("use_jrlx");
filter8=request.getParameter("filter8");
cond=cond+" "+filter8+" "+use_jrlx;
//out.println(cond);
//out.println("<br>");
//out.println(picked[i]);
}
if(i==8&&picked[i].equals("9"))
{
use_add=request.getParameter("use_add");
filter9=request.getParameter("filter9");
cond=cond+" "+filter9+" "+use_add;
//out.println(picked[i]);
//out.println(cond);
//out.println("<br>");
}
if(i==9&&picked[i].equals("10"))
{
reg_time =request.getParameter("reg_time");
filter10=request.getParameter("filter10");
cond=cond+" "+filter10+" "+reg_time;
//out.println(picked[i]);
//out.println(cond);
//out.println("<br>");
}
}
out.println(cond);
out.println("<br>");
}
else
{
out.println ("none");
}
%>
</body>
</html>
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!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>无标题文档</title>
<style type="text/css">
<!--
.style3 {font-size: 12px}
-->
</style>
</head>
<body>
<% String[] picked=request.getParameterValues("selectx");
String cond="";
int i;
String filter1,filter2,filter3,filter4,filter5,filter6,filter7,filter8,filter9,filter10;
String use_id,use_name,use_pho,use_count,work_name,qd_name,use_con,use_jrlx,use_add,reg_time;
if (picked != null)
{
for (i = 0;i < picked.length; i++)
{
if(i==0&&picked[i].equals("1"))
{
use_id=request.getParameter("use_id");
filter1=request.getParameter("filter1");
cond=filter1+" "+use_id;
//out.println(cond);
//out.println("<br>");
//out.println(picked[i]);
}
if(i==1&&picked[i].equals("2"))
{
use_name=request.getParameter("use_name");
filter2=request.getParameter("filter2");
cond=cond+" "+filter2+" "+use_name;
//out.println(cond);
//out.println("<br>");
//out.println(picked[i]);
}
if(i==2&&picked[i].equals("3"))
{
use_pho=request.getParameter("use_pho");
filter3=request.getParameter("filter3");
cond=cond+" "+filter3+" "+use_pho;
//out.println(cond);
//out.println("<br>");
//out.println(picked[i]);
}
if(i==3&&picked[i].equals("4"))
{
use_count=request.getParameter("use_count");
filter4=request.getParameter("filter4");
cond=cond+" "+filter4+" "+use_count;
//out.println(cond);
//out.println("<br>");
//out.println(picked[i]);
}
if(i==4&&picked[i].equals("5"))
{
work_name=request.getParameter("work_name");
filter5=request.getParameter("filter5");
cond=cond+" "+filter5+" "+work_name;
//out.println(cond);
//out.println("<br>");
//out.println(picked[i]);
}
if(i==5&&picked[i].equals("6"))
{
qd_name=request.getParameter("qd_name");
filter6=request.getParameter("filter6");
cond=cond+" "+filter6+" "+qd_name;
//out.println(cond);
//out.println("<br>");
//out.println(picked[i]);
}
if(i==6&&picked[i].equals("7"))
{
use_con=request.getParameter("use_con");
filter7=request.getParameter("filter7");
cond=cond+" "+filter7+" "+use_con;
//out.println(cond);
//out.println("<br>");
//out.println(picked[i]);
}
if(i==7&&picked[i].equals("8"))
{
use_jrlx=request.getParameter("use_jrlx");
filter8=request.getParameter("filter8");
cond=cond+" "+filter8+" "+use_jrlx;
//out.println(cond);
//out.println("<br>");
//out.println(picked[i]);
}
if(i==8&&picked[i].equals("9"))
{
use_add=request.getParameter("use_add");
filter9=request.getParameter("filter9");
cond=cond+" "+filter9+" "+use_add;
//out.println(picked[i]);
//out.println(cond);
//out.println("<br>");
}
if(i==9&&picked[i].equals("10"))
{
reg_time =request.getParameter("reg_time");
filter10=request.getParameter("filter10");
cond=cond+" "+filter10+" "+reg_time;
//out.println(picked[i]);
//out.println(cond);
//out.println("<br>");
}
}
out.println(cond);
out.println("<br>");
}
else
{
out.println ("none");
}
%>
</body>
</html>