By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,247 Members | 1,057 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,247 IT Pros & Developers. It's quick & easy.

Fill other drop down lists using value selected from a drop down list

P: 7
Hi there,

For my application, i need to have 3 drop down lists
1. drop down list of folder names
2. drop down list of documents in the folder selected
3. drop down list of instances of the document selected
(my application uses the BusinessObjects Java Web Services SDK)

The 2nd list is dependent on the 1st, while the 3rd list is dependent on the 2nd. In other words, this is what i want my application to do
-select a folder from the 1st drop down list
-the 2nd drop down list will be populate
-select a document from the 2nd drop down list
-the 3rd drop down list will be populate

I tried using javascript (onChange) to change the values in the 2nd list but i couldn't.

Should i
- create the 2nd and 3rd drop down lists as hidden and access them when the folder has been chosen
- create only the 1st drop down list and create the 2nd and 3rd as values are selected

Any help will be appreciated!
Jun 1 '07 #1
Share this Question
Share on Google+
3 Replies


dmjpro
100+
P: 2,476
Hi there,

For my application, i need to have 3 drop down lists
1. drop down list of folder names
2. drop down list of documents in the folder selected
3. drop down list of instances of the document selected
(my application uses the BusinessObjects Java Web Services SDK)

The 2nd list is dependent on the 1st, while the 3rd list is dependent on the 2nd. In other words, this is what i want my application to do
-select a folder from the 1st drop down list
-the 2nd drop down list will be populate
-select a document from the 2nd drop down list
-the 3rd drop down list will be populate

I tried using javascript (onChange) to change the values in the 2nd list but i couldn't.

Should i
- create the 2nd and 3rd drop down lists as hidden and access them when the folder has been chosen
- create only the 1st drop down list and create the 2nd and 3rd as values are selected

Any help will be appreciated!

R u trying reflect the list according to ur DataBase or it is known by u???
If it is from the data base then it is better to handle with AJAX.
If not then try using Option object in JS.
Try to search google .. how to update dynamic contents in select.
Best of luck.

Kind regards,
dmjpro.
Jun 2 '07 #2

10K+
P: 13,264
Hi there,

For my application, i need to have 3 drop down lists
1. drop down list of folder names
2. drop down list of documents in the folder selected
3. drop down list of instances of the document selected
(my application uses the BusinessObjects Java Web Services SDK)

The 2nd list is dependent on the 1st, while the 3rd list is dependent on the 2nd. In other words, this is what i want my application to do
-select a folder from the 1st drop down list
-the 2nd drop down list will be populate
-select a document from the 2nd drop down list
-the 3rd drop down list will be populate

I tried using javascript (onChange) to change the values in the 2nd list but i couldn't.

Should i
- create the 2nd and 3rd drop down lists as hidden and access them when the folder has been chosen
- create only the 1st drop down list and create the 2nd and 3rd as values are selected

Any help will be appreciated!
You cannot connect to a database using javascript.
So if all the data is stored in a database you'll need to use one of two methods.
1.)Load all the data from all the three tables into three arrays(or hidden selects). Then you can manipulate those arrays onChange of the selects.
2.) Load only the first non-dependant select. On change of that select, use Ajax to to call a server side script that returns the appropriate values for the other selects
Jun 2 '07 #3

acoder
Expert Mod 15k+
P: 16,027
Read up on AJAX with the tutorials in the Offsite Links stick thread (near the top of this forum). Some of them have examples similar to what you require. If you get stuck, post again with your code.
Jun 4 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.