Meaningless Drivel is fun!*
The moose likes HTML, CSS and JavaScript and the fly likes dynamically inter relate two drop down list in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "dynamically inter relate two drop down list in jsp" Watch "dynamically inter relate two drop down list in jsp" New topic
Author

dynamically inter relate two drop down list in jsp

vicky
Greenhorn

Joined: Apr 27, 2007
Posts: 1
Hi,

I am developing a webapplication using Javascript,JSP,Servlets. I have 2 dropdown lists in my form, the first one is autopopulated on form load , I have written this code in Jsp and its working as well, but now I want that once a user selects an option from the state then immediately the district should be populated depending on the selection made....
The state uses a diff table and so does the district , however their records are tied with a foreign key ..everytime the selected-option of state changes I need the district to be auto-populated with refreshed values...how can I achieve this?

Thanks,
Anupam Sinha
Ranch Hand

Joined: Apr 13, 2003
Posts: 1088
Use AJAX in case you are fetching the data on listbox change. Otherwise you can get all the mapping beforehand. In any case you would be using javascript.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: dynamically inter relate two drop down list in jsp
 
Similar Threads
name/value
dynamic value to be submitted to form beans
Populating a value based on the option selected in the dropdown
How to fill values in selectbox dynamically
how to get both value and text of selected item in action class