Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to insert selectd checkbox record from jsp in table?

 
pallavi chaudhari
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to insert selectd checkbox record from jsp in table?

String [] values = request.getParameterValues(); As it gives only value for selected checkbox that is on.

how to get all details of selected checkbox record?

please help....
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34422
347
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That code returns all the select values for the checkbox. Can you elaborate on what you are expecting or give an example?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64851
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
pallavi chaudhari wrote:As it gives only value for selected checkbox that is on.

That is correct. Unchecked check boxes do not have their values sent as part of the HTTP request.
 
pallavi chaudhari
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am giving my JSP pge.



I get selectede checkbox values as "on",but how to get selected checkbox row's all field values to store that all selectd record in table?
 
xsunil kumar
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can not get all data related to selected check box directly. You will get only value and your value is assoicated with check box. Check box value is value of primary key from list. So now you have primary key value in your servlet. You need to get this list again in servlet and fetch those values which are connected to the primary values coming from checkbox.

Sunil

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic