jQuery in Action
[Logo] JavaRanch » JavaRanch Saloon
  Search | FAQ | Recent Topics | Hot Topics
Register / Login


Reply Bookmark it! Watch this topic JavaRanch » Forums » Engineering » HTML and JavaScript
 
RSS feed
 
New topic
Author

how to implement dynamic choice box in jsp

abid ali shaikh
Greenhorn

Joined: Jan 03, 2009
Messages: 2

i have filled STATE choice box using JDBC in JSP
i want to fill CITY choice box on selecting STATE choice box in jsp

please help me

thank you

abid

This message was edited 2 times. Last update was at by abid ali shaikh

Bear Bibeault
Author and opinionated walrus
Sheriff

Joined: Jan 10, 2002
Messages: 36467

For that you'll need to use JavaScript and Ajax. I've moved this topic to the correct forum.

[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Bear Bibeault
Author and opinionated walrus
Sheriff

Joined: Jan 10, 2002
Messages: 36467

This is probably the most common question asked in this forum, as well on the web, regarding Ajax. Do a search and you will find hundreds, if not thousands of solutions.

One of the easiest, should you adopt jQuery to do you Ajax for you (highly recommended), is to use the jQuery load() method as follows:


where /fetchCities is a server-side resource (perhaps using Servlets and JSP -- which I know you know) that returns the formatted HTML options elements.

But looking around, you'll find that there are many different ways to do this.

[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Pavan Kumar Reddy
Greenhorn

Joined: Dec 11, 2009
Messages: 12

you can use freely use ajax technology so that you send request for server,and get a list of cities related to that state and put that all cities in the choice box using java script.This is the best solution among all after ajax technology came.
 
jQuery in Action
 
 
Reply Bookmark it! Watch this topic JavaRanch » Forums » Engineering » HTML and JavaScript
 
RSS feed
 
New topic
JProfiler
Get rid of your performance problems and memory leaks!