I am making a program in jsp servlet. There are three tables in database:
category , subcategory and items.
Their structure is like this ::
category 'C' .....
and so on.
I want to place 2 dropdown lists :: one which shows only category names n another
showing subcategory names..
the problem is, in subcategory dropdown i want only subcategories of the category i have
selected in first dropdown.
Example :: if i select category 'A' i want that second dropdown should display only
subcategory '1' and '2'.
any help regarding this will be appreciated.
Below is the code i have used for displaying category and subcategory dropdown in jsp page. but here
all subcategories are displayed irrespective of which category name i have selected.
First of all, modern JSPs should not contain any Java code or scriptlets. That's a bad practice that's been discredited since the introduction of the JSTL and EL with JSP 2.0 10 years ago!
Google for "cascading dropdowns". It's practically the poster child for Ajax examples.