aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes how to implement dynamic choice box   in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "how to implement dynamic choice box   in jsp" Watch "how to implement dynamic choice box   in jsp" New topic
Author

how to implement dynamic choice box in jsp

abid ali shaikh
Greenhorn

Joined: Jan 03, 2009
Posts: 3
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
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61426
    
  67

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


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61426
    
  67

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.
Pavan Kumar Reddy
Greenhorn

Joined: Dec 11, 2009
Posts: 13
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to implement dynamic choice box in jsp