• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dynamic Drop down based on another value in the same form

 
Serena Zhou
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In a JSP form, I want to give one of the drop down box's select value from DB based on the value that user has chosen from another drop down box, So that If I have chosen Unit A from Unit drop down box, the Employee drop down box will only show the employees from Unit A instead of all the employees from whole organization(Say in DB, they are tables with foreign key referring to each other )

Is there any way to do it?

Thanks!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65124
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Search through this and the HTML forum as this topic has been discussed on numerous occasions. You are bound to find info that is useful for you.
 
Sonny Gill
Ranch Hand
Posts: 1211
IntelliJ IDE Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Quick hint: The simplest way would be to submit the form when the user selects a value in the first dropdown, and populate the second dropdown based on user selection when showing the from again.

Otherwise, you can use Javascript, iframes etc..to dynamically update the second dropdown. As Bear said, you will find info on that if you search through the HTML forum.

Cheers.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic