*
The moose likes JSP and the fly likes How to get all dropdown values Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "How to get all dropdown values" Watch "How to get all dropdown values" New topic
Author

How to get all dropdown values

Rakesh Keerthi
Ranch Hand

Joined: Jul 16, 2012
Posts: 136
Hi,
i've a case where i have to get the total of all the dropdown elements. i'm able to achieve it individually. and the below is the code that worked for individual selection.



and the jsp is as below.


what i want is to get the sum of all when i select all in drop down.

Thanks
Esteban Herrera
author
Greenhorn

Joined: Dec 25, 2004
Posts: 21

Maybe in the All option of the first page you can put something like:


and in the second page, the query can be something like:


In the case of the other options, the "IN" will have the same effect that "=". But in the case of All, the SQL will be:


If possible, avoid using String values, try to use number values as identifiers and be sure to check the request for valid values and permissions, just in case someone tries to inject invalid values or malicious code.
Rakesh Keerthi
Ranch Hand

Joined: Jul 16, 2012
Posts: 136
Thanks for the solution Esteban . but i wanted to print them in separate rows in a table like Updates: (total), Admin Codes: (total).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to get all dropdown values
 
Similar Threads
How to get all dropdown values
Add options text to select from javascript?
jsp form with two submit button
Redirct page in Tilse with JSTL
how to get form parameters data to a servlet?