File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes getParameterMap and unselected checkboxes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "getParameterMap and unselected checkboxes" Watch "getParameterMap and unselected checkboxes" New topic
Author

getParameterMap and unselected checkboxes

Ken Clark
Greenhorn

Joined: Aug 02, 2004
Posts: 11
I'm processing information from a form in a servlet that consists of a table of data, each with a checkbox. Some are selected, and others are not. When I user getParameterMap() or getParameterNames(), I'm only getting data for those rows that have the checkbox selected (true).
How do I also get the checkboxes that are no selected?

Ken
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60057
    
  65

You don't. Parameters for unselected checkboxes are not included in the HTTP request when the browser submits the form.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1506
As Bear said, only selected parameters are sent as part of the request. But, since you know those that are selected, you can easily detemine those that are not right?


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: getParameterMap and unselected checkboxes
 
Similar Threads
Most recently selected checkbox
How to get Names of selected checkboxes?
Maintain checked and unchecked in checkbox in pagination in display tag in struts
Retaining value of checkbox when returning back from a servlet
Problem with selecting checkboxes in subTable