File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » JSP
Bookmark "jsp - checkbox information retieval problem" Watch "jsp - checkbox information retieval problem" New topic

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><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">
<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>

//Get the catalog entries
Vector items = Catalog.getItems();

for (int i =0; i<items.size(); i++) {
Item myitem =(Item)items.elementAt(i);
<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>
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63844

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

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: jsp - checkbox information retieval problem
It's not a secret anymore!