Win a copy of Practice Tests for OCP Java 17 Certification Exam (1Z0-829) this week in the OCPJP forum!
  • 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 ...
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

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><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>
Posts: 67641
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().
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic