aspose file tools*
The moose likes JSP and the fly likes How to insert selectd checkbox record from jsp in table? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "How to insert selectd checkbox record from jsp in table?" Watch "How to insert selectd checkbox record from jsp in table?" New topic
Author

How to insert selectd checkbox record from jsp in table?

pallavi chaudhari
Ranch Hand

Joined: Jul 02, 2008
Posts: 54
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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30353
    
150

That code returns all the select values for the checkbox. Can you elaborate on what you are expecting or give an example?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61066
    
  66

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
pallavi chaudhari
Ranch Hand

Joined: Jul 02, 2008
Posts: 54
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

Joined: Dec 14, 2009
Posts: 133
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

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to insert selectd checkbox record from jsp in table?