• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Dynamic Drop down based on another value in the same form

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Sheriff
Posts: 67634
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 1211
Mac IntelliJ IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
What are your superhero powers? Go ahead and try them on this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic