wood burning stoves 2.0*
The moose likes JSP and the fly likes jsp - checkbox information retieval problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "jsp - checkbox information retieval problem" Watch "jsp - checkbox information retieval problem" New topic
Author

jsp - checkbox information retieval problem

kishani liyanage
Ranch Hand

Joined: Dec 08, 2003
Posts: 40
hey i need some help! I have a jsp which has a list of checkboxes to select from. I want to know how i can display the selected checkboxes using another jsp. Please illustrate if u can = My jsp is given below!
<form action="showDetails.jsp" method=GET>
<input type=hidden name=action value=0>
<tr bgcolor="#9999FF">
<td><br></b></td>

<td><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2">
Item Description</font></br><td>
<td><b><font face="Verdana, arial,Helvetica, sans-serif" size="2">
Price</font></b></td>
<td><b><font face="Verdana, Aria, Helvetica, sans-serif" size="2">
In Stock</font></b></td>
<td><b><font face="verdana, Arial, Helvetica, sans-serif" size="2">
Quantity in stock</font></b></td>

</tr>
<%
//Get the catalog entries
Vector items = Catalog.getItems();

for (int i =0; i<items.size(); i++) {
Item myitem =(Item)items.elementAt(i);
%>
<tr>
<td><input type=checkbox name=itemId
value=<%= myitem.getItemId() %> ></td>
<td><%= myitem.getDescription()%></td>
<td><%= myitem.getPrice() %></td>
<td><%= myitem.getAvailable() %></td>
<td><%= myitem.getQuantity_in_stock() %></td>
</tr>
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61420
    
  67

Since all the checkboxes have the same name, you can get the list of checked values with request.getParameterValues().


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jsp - checkbox information retieval problem