Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How do I use one drop down list to refresh the list in another drop down?

843840Jan 11 2009 — edited Jan 12 2009
I am using a drop down list full of years (i.e. 2008, 2009..etc). When I make my selection from this drop down list (say for instance I select 2009) I want it to update the available data in the second drop down list. I have the query statement set up within the JSP page but it needs to be a dynamic SQL statement based off the value I selected in the first drop down.

String sql = "SELECT GameId, GameDescription FROM Games WHERE Year = " + year;

The variable "year" is the value I need to figure out how to assign. Now this variable is a Java variable (attribute) and Im unsure how to get the value from the previous drop down and assign it to that. Basically I need the JavaScript value from the first drop down assigned to the Java attribute "year".

Anyone able to help me with this???

Thanks,
Jed
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 9 2009
Added on Jan 11 2009
5 comments
1,328 views