aspose file tools*
The moose likes Servlets and the fly likes How to get Names of selected checkboxes? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to get Names of selected checkboxes?" Watch "How to get Names of selected checkboxes?" New topic
Author

How to get Names of selected checkboxes?

Pramod P Deore
Ranch Hand

Joined: Jul 15, 2008
Posts: 629

Hi..
I want to know that how we can get names of selected checkboxes?

Thanks


Life is easy because we write the source code.....
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60041
    
  65

The names of the selected checkboxes will be submitted as request parameters with the value assigned to each checkbox.

Non-selected checkboxes will not be passed at all.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Pramod P Deore
Ranch Hand

Joined: Jul 15, 2008
Posts: 629

Hello Sir, Thanks for quick reply,

I have following html file in which user can select checkboes




and I have following Servlet class



Now when I hit the Url I get Output as from which department I had selected the book . Now I want to print the name of book also How I can do this in servlet .

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60041
    
  65

Your HTML is incomplete. The checkboxes have no value attributes to distinguish between them.
Pramod P Deore
Ranch Hand

Joined: Jul 15, 2008
Posts: 629

oh yes

This is my new HTML file

Pramod P Deore
Ranch Hand

Joined: Jul 15, 2008
Posts: 629

Thank You Sir, because of incomplete Html code I had not getting the name of the book But now I got it.

Thanks again.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60041
    
  65

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to get Names of selected checkboxes?
 
Similar Threads
how checkbox works in servlets?
how to get selected check box values in struts?
req.getParameterValues returning null
Fetching checked data from html:checkbox inside logic:iterate
getParameterMap and unselected checkboxes