PDA

View Full Version : Chained select menu with xml??



LisaR1234
08-17-2006, 06:17 PM
1) Script Title: Chained select menu

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/chainedmenu/index.htm

3) Describe problem:

Hi,

I am very new to xml but I do have experience with Javascript. I am using a chained select menu found at: http://www.dynamicdrive.com/dynamicindex1/chainedmenu/index.htm
as my code. When the first box is selected the second is populated based on the first boxes selection and so on.

The information populated inside the 3 drop down boxes changes frequently and at the moment I have the text and values hard coded. Is there a way to have the text and values populated based on an xml file?

I do have the text and values needed to populate all drop down boxes available in an xml file but I do not know how to link the xml file to be the source of the JS drop down boxes.

addOption("ACCT_MODEL", "VAL_2", "Reports/Account/account+acct_model/5.htm");

For ex. the "val_2" and "5.htm" is available in an xml file. I just need some help figuring out is I can use the xml as the source to populate each 'addoption'. Any help would be greatly appreciated!!

-----------------
Source JS code:

addOption("ACCT_MODEL", "Select an item", "", 1); //HEADER OPTION
addOption("ACCT_MODEL", "All Attributes", "Reports/Account/account+acct_model/10.htm");
addOption("ACCT_MODEL", "VAL_1", [/B[B]]"Reports/Account/account+acct_model/4.htm");
addOption("ACCT_MODEL", "VAL_2", "Reports/Account/account+acct_model/5.htm");
addOption("ACCT_MODEL", "VAL_3", "Reports/Account/account+acct_model/6.htm");
addOption("ACCT_MODEL", "VAL_4", "Reports/Account/account+acct_model/7.htm");
addOption("ACCT_MODEL", "VAL_5", "Reports/Account/account+acct_model/8.htm");
addOption("ACCT_MODEL", "VAL_6", "Reports/Account/account+acct_model/9.htm");

scott_in_space
06-24-2007, 06:54 AM
I also have a need for this: to populate HTML SELECT menus with XML data.

Does anyone have a solution?

Thank you.

- Scott
Scottsdale, AZ 06-23-2007