PDA

View Full Version : Problem with Chained Menu



mvigil514
05-28-2007, 02:03 AM
1) Script Title: chainedmenu

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

3) Describe problem: I've modified the script to have four fields. I can't seem to get it to work properly. It seems to be tied to the order in which the addList and addOption is in config.js. This my config.js:

//var hide_empty_list=true; //uncomment this line to hide empty selection lists
var disable_empty_list=true; //uncomment this line to disable empty selection lists

var onclickaction="alert" //set to "alert" or "goto". Former is for debugging purposes, to tell you the value of the final selected list that will be used as the destination URL. Set to "goto" when below configuration is all set up as desired.

var newwindow=0 //Open links in new window or not? 1=yes, 0=no.

/////DEFINE YOUR MENU LISTS and ITEMS below/////////////////

addListGroup("chainedmenu", "First-Select");

addOption("First-Select", "Please select which issue most closely matches your problem.", "", 1); //HEADER OPTION
addList("First-Select", "I don't know how to use my financial software.", "", "Software");
addList("First-Select", "I don't know how to use my browser.", "", "Browser");
addList("First-Select", "I don't know how to use my computer.", "", "Computer");

addOption("Software", "Please select your software.", "", 1); //HEADER OPTION
addList("Software", "Microsoft Money", "", "MSMoney");
addList("Software", "Intuit Quicken", "", "Quicken");
addList("Software", "Intuit Quickbooks", "", "Quickbooks");

addOption("Browser", "Please select your browser", "", 1); //HEADER OPTION
addList("Browser", "Internet Explorer", "", "Explorer");
addList("Browser", "Firefox", "", "Firefox");
addList("Browser", "Other", "", "OtherBrowser");

addOption("Computer", "Please select a Computer problem.", "", 1); //HEADER OPTION
addOption("Computer", "I'm just dumb!", "dumb_faqs.html");
addOption("Computer", "My computer won't connect to the internet.", "Internet.html");
addOption("Computer", "My computer won't turn on.", "Power.html");

addOption("MSMoney", "Please select a MSMoney problem", "", 1); //HEADER OPTION
addList("MSMoney", "MSMoney Issue #1", "", "MSMoney1");
addList("MSMoney", "MSMoney Issue #2", "", "MSMoney2");
addOption("MSMoney", "MSMoney Issue #3", "MSMoneyIssue3.html");

addOption("Quicken", "Please select a Quicken problem.", "", 1); //HEADER OPTION
addList("Quicken", "Quicken Issue #1", "", "Quicken1");
addList("Quicken", "Quicken Issue #2", "", "Quicken2");
addOption("Quicken", "Quicken Issue #3", "QuickenIssue3.html");
addOption("Quicken", "Quicken Issue #4", "QuickenIssue4.html");

addOption("Quickbooks", "Please select a Quickbooks problems", "", 1); //HEADER OPTION
addList("Quickbooks", "Quickbooks Issue #1", "", "Quickbooks1");
addList("Quickbooks", "Quickbooks Issue #2", "", "Quickbooks2");
addOption("Quickbooks", "Quickbooks Issue #3", "QuickbooksIssue3.html");
addOption("Quickbooks", "Quickbooks Issue #4", "QuickbooksIssue4.html");

addOption("Explorer", "Select an Explorer problem", "", 1); //HEADER OPTION
addList("Explorer", "Explorer Issue #1", "", "Explorer1");
addList("Explorer", "Explorer Issue #2", "", "Explorer2");
addOption("Explorer", "Explorer Issue #3", "ExplorerIssue3.html");
addOption("Explorer", "Explorer Issue #4", "ExplorerIssue4.html");

addOption("Explorer1", "Please select a problem related to Explorer Issue #1", "", 1); //HEADER OPTION
addOption("Explorer1", "Explorer1 Issue #1", "Explorer1Issue1.html");
addOption("Explorer1", "Explorer1 Issue #2", "Explorer1Issue2.html");
addOption("Explorer1", "Explorer1 Issue #3", "Explorer1Issue3.html");
addOption("Explorer1", "Explorer1 Issue #4", "Explorer1Issue4.html");
addOption("Explorer1", "Explorer1 Issue #5", "Explorer1Issue5.html");
addOption("Explorer1", "Explorer1 Issue #6", "Explorer1Issue6.html");
addOption("Explorer1", "Explorer1 Issue #7", "Explorer1Issue7.html");

addOption("Explorer2", "Please select a problem related to Explorer Issue #2", "", 1); //HEADER OPTION
addOption("Explorer2", "Explorer2 Issue #1", "Explorer2Issue1.html");
addOption("Explorer2", "Explorer2 Issue #2", "Explorer2Issue2.html");
addOption("Explorer2", "Explorer2 Issue #3", "Explorer2Issue3.html");
addOption("Explorer2", "Explorer2 Issue #4", "Explorer2Issue4.html");

addOption("Firefox", "Select a Firefox problem", "", 1); //HEADER OPTION
addList("Firefox", "Firefox Issue #1", "", "Firefox1");
addList("Firefox", "Firefox Issue #2", "", "Firefox2");
addOption("Firefox", "Firefox Issue #3", "FirefoxIssue3.html");
addOption("Firefox", "Firefox Issue #4", "FirefoxIssue4.html");

addOption("Firefox1", "Please select a problem related to Firefox Issue #1", "", 1); //HEADER OPTION
addOption("Firefox1", "Firefox1 Issue #1", "Firefox1Issue1.html");
addOption("Firefox1", "Firefox1 Issue #2", "Firefox1Issue2.html");
addOption("Firefox1", "Firefox1 Issue #3", "Firefox1Issue3.html");
addOption("Firefox1", "Firefox1 Issue #4", "Firefox1Issue4.html");
addOption("Firefox1", "Firefox1 Issue #5", "Firefox1Issue5.html");

addOption("Firefox2", "Please select a problem related to Firefox Issue #2", "", 1); //HEADER OPTION
addOption("Firefox2", "Firefox2 Issue #1", "Firefox2Issue1.html");
addOption("Firefox2", "Firefox2 Issue #2", "Firefox2Issue2.html");
addOption("Firefox2", "Firefox2 Issue #3", "Firefox2Issue3.html");
addOption("Firefox2", "Firefox2 Issue #4", "Firefox2Issue4.html");
addOption("Firefox2", "Firefox2 Issue #5", "Firefox2Issue5.html");
addOption("Firefox2", "Firefox2 Issue #6", "Firefox2Issue6.html");
addOption("Firefox2", "Firefox2 Issue #7", "Firefox2Issue7.html");
addOption("Firefox2", "Firefox2 Issue #8", "Firefox2Issue8.html");
addOption("Firefox2", "Firefox2 Issue #9", "Firefox2Issue9.html");
addOption("Firefox2", "Firefox2 Issue #10", "Firefox2Issue10.html");
addOption("Firefox2", "Firefox2 Issue #11", "Firefox2Issue11.html");
addOption("Firefox2", "Firefox2 Issue #12", "Firefox2Issue12.html");
addOption("Firefox2", "Firefox2 Issue #13", "Firefox2Issue13.html");

addOption("OtherBrowser", "Select a problem related to Other Browsers", "", 1); //HEADER OPTION
addOption("OtherBrowser", "Other Browser Issue #1", "OtherBrowserIssue1.html");
addOption("OtherBrowser", "Other Browser Issue #2", "OtherBrowserIssue2.html");

addOption("MSMoney1", "Please select a problem related to MSMoney Issue #1", "", 1); //HEADER OPTION
addOption("MSMoney1", "MSMoney1 Issue #1", "MSMoney1Issue1.html");
addOption("MSMoney1", "MSMoney1 Issue #2", "MSMoney1Issue2.html");
addOption("MSMoney1", "MSMoney1 Issue #3", "MSMoney1Issue3.html");
addOption("MSMoney1", "MSMoney1 Issue #4", "MSMoney1Issue4.html");
addOption("MSMoney1", "MSMoney1 Issue #5", "MSMoney1Issue5.html");
addOption("MSMoney1", "MSMoney1 Issue #6", "MSMoney1Issue6.html");
addOption("MSMoney1", "MSMoney1 Issue #7", "MSMoney1Issue7.html");
addOption("MSMoney1", "MSMoney1 Issue #8", "MSMoney1Issue8.html");

addOption("MSMoney2", "Please select a problem related to MSMoney Issue #2", "", 1); //HEADER OPTION
addOption("MsMoney2", "MSMoney2 Issue #1", "MSMoney2Issue1.html");
addOption("MsMoney2", "MSMoney2 Issue #2", "MSMoney2Issue2.html");
addOption("MsMoney2", "MSMoney2 Issue #3", "MSMoney2Issue3.html");
addOption("MsMoney2", "MSMoney2 Issue #4", "MSMoney2Issue4.html");
addOption("MsMoney2", "MSMoney2 Issue #5", "MSMoney2Issue5.html");
addOption("MsMoney2", "MSMoney2 Issue #6", "MSMoney2Issue6.html");

addOption("Quicken1", "Please select a problem related to Quicken Issue #1", "", 1); //HEADER OPTION
addOption("Quicken1", "Quicken1 Issue #1", "Quicken1Issue1.html");
addOption("Quicken1", "Quicken1 Issue #2", "Quicken1Issue2.html");
addOption("Quicken1", "Quicken1 Issue #3", "Quicken1Issue3.html");
addOption("Quicken1", "Quicken1 Issue #4", "Quicken1Issue4.html");
addOption("Quicken1", "Quicken1 Issue #5", "Quicken1Issue5.html");

addOption("Quicken2", "Please select a problem related to Quicken Issue #2", "", 1); //HEADER OPTION
addOption("Quicken2", "Quicken2 Issue #1", "Quicken2Issue1.html");
addOption("Quicken2", "Quicken2 Issue #2", "Quicken2Issue2.html");
addOption("Quicken2", "Quicken2 Issue #3", "Quicken2Issue3.html");
addOption("Quicken2", "Quicken2 Issue #4", "Quicken2Issue4.html");
addOption("Quicken2", "Quicken2 Issue #5", "Quicken2Issue5.html");

addOption("Quickbooks1", "Please select a problem related to Quickbooks Issue #1", "", 1); //HEADER OPTION
addOption("Quickbooks1", "Quickbooks1 Issue #1", "Quickbooks1Issue1.html");
addOption("Quickbooks1", "Quickbooks1 Issue #2", "Quickbooks1Issue2.html");
addOption("Quickbooks1", "Quickbooks1 Issue #3", "Quickbooks1Issue3.html");

addOption("Quickbooks2", "Please select a problem related to Quickbooks Issue #2", "", 1); //HEADER OPTION
addOption("Quickbooks2", "Quickbooks2 Issue #1", "Quickbooks2Issue1.html");
addOption("Quickbooks2", "Quickbooks2 Issue #2", "Quickbooks2Issue2.html");
addOption("Quickbooks2", "Quickbooks2 Issue #3", "Quickbooks2Issue3.html");


Any help would be appreciated.

mvigil514
05-28-2007, 02:04 AM
This is the html code:

<html>

<head>
<title>Sample Support Navigation Menu</title>
<script language="javascript" src="chainedmenu.js">

/***********************************************
* Chained Select Menu- By Xin Yang (http://www.yxscripts.com/) & Dynamic Drive (http://dynamicdrive.com)
* Script featured on/available at http://www.dynamicdrive.com/
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
* This notice must stay intact for legal use!
***********************************************/

</script>
<script language="javascript" src="config.js"></script>
<script language="javascript">
function runit()
{
initListGroup('chainedmenu', document.listmenu0.firstlevel, document.listmenu0.secondlevel, document.listmenu0.thirdlevel, document.listmenu0.fourthlevel);
MM_preloadImages('images/_buttons/b_header_home_on.gif','images/_buttons/b_nav_online_roll.gif','images/_buttons/b_nav_heloc_roll.gif','images/_buttons/b_nav_certificates_roll.gif','images/_buttons/b_nav_checking_roll.gif','images/_buttons/b_nav_money_roll.gif','images/_buttons/b_nav_visa_roll.gif','images/_buttons/b_header_about_on.gif','images/_buttons/b_header_eoffers_on.gif','images/_buttons/b_header_loans_on.gif','images/_buttons/b_header_accounts_on.gif','images/_buttons/b_header_services_on.gif','images/_buttons/b_header_locations_on.gif','images/_buttons/b_header_help_on.gif','images/_buttons/b_nav_auto_r.gif','images/_buttons/b_nav_mortgage_onn.gif','/_images/b_home_on.gif','/_images/b_about_on.gif','/_images/b_eoffers_on.gif','/_images/b_personal_on.gif','/_images/b_business_on.gif','/_images/b_services1_on.gif','/_images/b_locations1_on.gif');
}
//-->
</script>
</head>

<body onload="runit()">

<form name="listmenu0">
<table align="center">
<tr>
<td>Please select the option that most closely matches your problem.</td>
</tr>
<tr>
<td><select name="firstlevel" style="width:400px;"></select></td>
</tr>
<tr>
<td><img src="images/pixel_trans.gif" border="0" width="10" height="20"></td>
</tr>
<tr>
<td>Please select the financial program you are using.</td>
</tr>
<tr>
<td><select name="secondlevel" style="width:400px;"></select></td>
</tr>
<tr>
<td><img src="images/pixel_trans.gif" border="0" width="10" height="20"></td>
</tr>
<tr>
<td>Please select which browser you are currently using.</td>
</tr>
<tr>
<td><select name="thirdlevel" style="width:400px;"></select></td>
</tr>
<tr>
<td><img src="images/pixel_trans.gif" border="0" width="10" height="20"></td>
</tr>
<tr>
<td>Please select a question.</td>
</tr>
<tr>
<td><select name="fourthlevel" style="width:400px;"></select></td>
</tr>
<tr>
<td><img src="images/pixel_trans.gif" border="0" width="10" height="20"></td>
</tr>
<tr>
<td><input type="button" value="Submit" onclick="goListGroup(document.listmenu0.firstlevel, document.listmenu0.secondlevel, document.listmenu0.thirdlevel, document.listmenu0.fourthlevel)">
<input type="button" value="Clear" onclick="resetListGroup('chainedmenu')">
</td>
</td>
</table>
</form>

</body>

</html>

Here is a link to the web page: http://www.aircoac.com/menu/sample.html

Again, any help is appreciated!

mvigil514
05-28-2007, 06:40 PM
Does anyone have any ideas? I can make most of the form work by rearranged the order of the lists/options. I get this error when I try to access parts of the form.

http://www.aircoac.com/menu/images/untitled.bmp

I would appreciate any help anyone can give. I've rearranged the code to death and seem to be getting nowhere.

Thanks