File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes dynamically populating drop down list Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "dynamically populating drop down list" Watch "dynamically populating drop down list" New topic

dynamically populating drop down list

Naresh Chaurasia
Ranch Hand

Joined: May 18, 2005
Posts: 361
Hi folks, i am having two drop down list. List1 has countries and List2 has corresponding state the countries in List1.

If is select US in List1, can i populate the states in US in List2. If the user changes to India in List1 the the List2 is populated with the corresponding states, using javascript.

thnx in advance

SCJP 1.4, SCWCD1.4, OCA(1Z0-007)
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
called a double combo or linked select. You can either do it with a traditional postback or with Ajax. Search Google, there are plenty of examples out there.

I agree. Here's the link:
subject: dynamically populating drop down list
It's not a secret anymore!