This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes JSP and the fly likes Dynamic combo box Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Dynamic combo box" Watch "Dynamic combo box" New topic

Dynamic combo box


Joined: Dec 15, 2006
Posts: 18
i my application i need to select two values
for example name of country and state.
if i select name of country from first then automatically
only names of states in that country should come in the second combo
how can i achieve this
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Hi Santosh,

This is a very common question.
Search this, and the HTML/Javascript forum.
There are several approaches to doing this.
All have been discussed at length.

When searching, you'll probably have better luck if you use the term "select list". Combo boxes do not exist in HTML.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63548

A term for this that I see bandied about often is "dependent dropdowns".

[Asking smart questions] [About Bear] [Books by Bear]
Joshua Cloch
Ranch Hand

Joined: Apr 27, 2006
Posts: 95
or you can search "double combo".
I agree. Here's the link:
subject: Dynamic combo box
It's not a secret anymore!