• Post Reply Bookmark Topic Watch Topic
  • New Topic

jsp with javascript problem  RSS feed

 
hem kumar
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all, i have 2 drop down list in a registration page, say, registration.jsp.

The code is like this ->

"the code here is very basic--just for demo purpose"

what i like to know is if i choose any particular country in 1st list then all the states of that country should appear in the 2nd list.

please help me to resolve this. and secondly is it possible to capture the country name in javascript and then access it in jsp and prepare a query so that i can retrieve all the appropriate state names in 2nd list?

I have also requisite tables country, state etc
country table has 2 columns like -> country_id, country_name
state table has 3 columns like -> state_id, state_name, country_id

Thank you all.........



[BSouther: Added UBB CODE tags]
[ November 20, 2007: Message edited by: Ben Souther ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This problem is the poster child for AJAX and is asked about often here.

Search this, the HTML/Javascript forum and Google for "dependent dropdowns' or "cascading dropdowns" and you'll find several different approaches.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!