I have two tables in my Database. One is Department and other is Manager. I created a drop down in JSP and it shows list of Departments from Database. I want to show list of Managers in another dropdown based on Department selected. how to achieve this?
Here, I am referring to cascading dropdowns. Thanks you.
You have given no HTML or any script you have tried yourself as such the below should serve as a good template for you to get started.
DEMO – Cascading dropdowns, show managers for selected department
Assuming the following HTML
When you have loaded the departments and managers from the database you can dynamically populate the selects with code similar to this:
I have hard-coded the department and manager sources as I don’t have a database.