标题:[求助]为什么我用checkbox出错,急
只看楼主
sy8000
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2007-7-4
 问题点数:0 回复次数:0 
[求助]为什么我用checkbox出错,急

///1.jsp
<input type="checkbox" name="checkbox" value="xfjssq.dbo.sbspk.skgk_dm,">国库&nbsp;&nbsp;
<input type="checkbox" name="checkbox" value="xfjssq.dbo.sbspk.zsxm_dm,">税(费)种&nbsp;&nbsp;
<input type="checkbox" name="checkbox" value="xfjssq.dbo.sbspk.ysfpbl_dm,">预算级次&nbsp;&nbsp;
<input type="checkbox" name="checkbox" value="xfjssq.dbo.sbspk.nsr_swjg_dm,">征管单位&nbsp;&nbsp;
<input type="checkbox" name="checkbox" value="xfjssq.dbo.sbspk.zspm_dm,">税(费)目&nbsp;&nbsp;
<input type="checkbox" name="checkbox" value="xfjssq.dbo.sbspk.yskm_dm,">预算科目&nbsp;&nbsp;
<input type="checkbox" name="checkbox" value="xfjssq.dbo.sbspk.djzclx_dm,">注册类型</tr>


///2.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" import="java.sql.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%! //Connection conn;Statement st;ResultSet rs;String sql,sql1,sql2,sql3,sql4; %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body background="/img/bgimg.jpg">
<center>银行对帐查询结果</center><hr>
<% String sql;

String check[] = request.getParameterValues("checkbox");
try{

sql="select distinct ";

int i=0;
while(i<7){
sql+=check[i];
i++;
}
out.println(sql);

}catch(Exception e){
e.getStackTrace();
}
%>
</body>
</html>

复选框全选中时正常,但只要有一个不选,语句就不显示,请问为什么谢谢

搜索更多相关主题的帖子: checkbox input value 
2007-08-09 11:30



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-161448-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.012592 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved