File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply 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 opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 50691

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
Marshal

Joined: Jan 10, 2002
Posts: 50691

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: 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.
 
 
subject: how to implement dynamic choice box in jsp
 
Threads others viewed
using JSP inside javascript
Bitwise use of SQL integer
combobox query
JSP Questions;
drop down List box in jsp
developer file tools