File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Drop-down text selection in jsp/html Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Drop-down text selection in jsp/html" Watch "Drop-down text selection in jsp/html" New topic

Drop-down text selection in jsp/html

swati mppy

Joined: Jul 03, 2011
Posts: 7

I am trying to create JSP page where I have two drop-downs. There are two-sets of data - First set Categories- Movies, Books, Music and the Second set Genres- Action,Comedy,Romantic.

Now the first dropdown will have all the values. The second drop-down depends upon the first one. For eg: If I select Movies from first dropdown, the second dropdown wil have-Action,Comedy,Romantic (all genres of Movies will be dispalyed). If I select Action from first dropdown, the second dropdown will have- Movies,Books,Music (all categories for Action will be displayed).

How can I create such dynamic dropdowns.

Also based on the values selected in the drop-downs, I should form a query path as Movies/Action or Action/Movies. I need to break up this path and query the database. So how can i know in the backend which is first category or genre.

I do not wish to use String manipulation since the data in the dropdowns can vary.I need some generic solution.

Its little complicated. Please let me know if anyone has a idea on this.Please help.


I agree. Here's the link:
subject: Drop-down text selection in jsp/html
It's not a secret anymore!