Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to get Names of selected checkboxes?

 
Pramod P Deore
Ranch Hand
Posts: 632
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..
I want to know that how we can get names of selected checkboxes?

Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64970
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Pramod P Deore
Ranch Hand
Posts: 632
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64970
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your HTML is incomplete. The checkboxes have no value attributes to distinguish between them.
 
Pramod P Deore
Ranch Hand
Posts: 632
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oh yes

This is my new HTML file

 
Pramod P Deore
Ranch Hand
Posts: 632
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64970
86
IntelliJ IDE Java jQuery Mac Mac OS X
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic