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 Dependent select list query 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 "Dependent select list query" Watch "Dependent select list query" New topic

Dependent select list query

Nidhi Singhal
Ranch Hand

Joined: Sep 19, 2004
Posts: 89


I have two drop down list. when i select a value in the first list, the corresp value in the second select list gets selected..
i want that the user should not be able to select another value in the second select list without changing the value in the first list...
how should i go about it??
Plz help me out..

Balan Raj
Ranch Hand

Joined: Aug 26, 2003
Posts: 74
Trap the event onselect or onFocus on the dependent selection box and call blur() for the second selection box.

it wud mean that you will never be able to select the second selection list at all.
[ October 12, 2004: Message edited by: Balan Ram ]
Nidhi Singhal
Ranch Hand

Joined: Sep 19, 2004
Posts: 89

thanx for the reply...
i used onBlur() on the onFocus() event of the second(dependent) select box... but it did'nt worked... so..i tried calling onFocus() of the first select box on the onFocus of the second select box...
this thing worked somewhat.... as now if i try to drop down the second select....then after 3-4 tries only..i m able to drop down and select another value....

is there any way that i can set the drop down to false?
or is there any other way out to the problem??
plz help..

Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
disable the second box

I agree. Here's the link:
subject: Dependent select list query
It's not a secret anymore!