[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
[Home]
Can't get multiple checkbox's value
- To: "gnujsp" <gnujsp@gjt.org>
- Subject: Can't get multiple checkbox's value
- From: =?gb2312?B?us7Wvse/?= <hhzqq@chinaweal.com>
- Date: Fri, 7 Jan 2000 14:05:26 -0800
- Organization: =?gb2312?B?1tDN+8nM0rW7+sb309DP3rmry77Qxc+i1tDQxA==?=
here is my jsp,when i check two checkboxes with the same name,i can only get
the first checkbox's value,why,i tested in ASP,i can get all my checked
checkbox's values,is this a gnujsp's bug?
<%@ page info="JSP Implict Object¡¡£¡¡request" %>
<%@ page import="java.util.Enumeration" %>
<html>
<head><title>JSP Implict Object¡¡£¡¡request</title></head>
<body>
<%!
Enumeration Enum;
Object Obj;
String StrArray[];
int i;
%>
<form action="request.jsp" method="post">
FormInputCheckBox£º<br>
<input type="checkbox" name="FormInputCheckBox"
value="CheckBox1">CheckBox1<br>
<input type="checkbox" name="FormInputCheckBox"
value="CheckBox2">CheckBox2<br>
<input type="checkbox" name="FormInputCheckBox"
value="CheckBox3">CheckBox3<br>
<input type="submit">
</form>
<%
Enum = request.getParameterNames();
while(Enum.hasMoreElements()){
Obj = Enum.nextElement();
StrArray = request.getParameterValues((String)Obj);
%>
<%= Obj%>£º
<%
for(i=0;i<StrArray.length;i++){
out.print(StrArray[i]);
}
%>
<br>
<%
}
%>
</body>
</html>