This week's book giveaway is in the General Computing forum.
We're giving away four copies of Learning Regular Expressions and have Ben Forta on-line!
See this thread for details.
Win a copy of Learning Regular Expressions this week in the General Computing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

How to get all dropdown values  RSS feed

 
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
author
Ranch Hand
Posts: 42
1
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 153
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the solution Esteban . but i wanted to print them in separate rows in a table like Updates: (total), Admin Codes: (total).
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!