Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

dynamically inter relate two drop down list in jsp

 
vicky
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1090
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic