• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

jsp - checkbox information retieval problem

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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>
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since all the checkboxes have the same name, you can get the list of checked values with request.getParameterValues().
reply
    Bookmark Topic Watch Topic
  • New Topic