PDA

View Full Version : Chained Menu Link Help--Urgent



bennyyaya
03-09-2005, 03:43 PM
I have downloaded and edited the config.js, and chainedmenu.js. The problem is when I test it, everything just seems to work. However, when I press the "go" button, the page just refreshes and does not go to the url I want it to go it. :confused: If it at least went to any url I could figure out how to change the url. Basically, the resulted url should point to the appropriate products in my shopping cart based on what is chosen in my 3 drop down lists. FYI: if you visit the link below you will see "[Destination] not found" in the status bar. I think this is an issue but I don't see where to fix it. :confused:

Can someone tell me if I have the javascripts correct, such as where I entered my data and if my index.php (http://www.weekendsaway.com/store) is set up right to actually goto the url.

index.php= <body onload="initListGroup('chainedmenu', document.listmenu0.firstlevel, document.listmenu0.secondlevel, document.listmenu0.thirdlevel,'saveit')" text="#666666" link="#6699cc" vlink="#6699cc" alink="#6699cc">
gotobutton on index.php= <input type="submit" value="Go" onclick="goTo(goListGroup(document.listmenu0.firstlevel, document.listmenu0.secondlevel, document.listmenu0.thirdlevel)"


To see the page: http://www.weekendsaway.com/store

This is how my chainedmenu.js looks:

var onclickaction="goto"

function goListGroup(){
for (i=arguments.length-1;i>=0; i--){
if (arguments[i].selectedIndex!=-1){
var selectedOptionvalue=arguments[i].options[arguments[i].selectedIndex].value
if (selectedOptionvalue!=""){
if (onclickaction=="goto")
alert(selectedOptionvalue)
else if (newwindow==1)
window.open(selectedOptionvalue)
else
window.location=selectedOptionvalue
break
}
}
}
}

///// END DynamicDrive.com added function//////

and this is a snippet of my config.js

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

addOption("First-Select", "select", "", 1); //HEADER OPTION
addList("First-Select", "girl's getaway", "", "girlsgetaway");
addList("First-Select", "guy's getaway", "", "guysgetaway");
addList("First-Select", "father's day", "", "fathersday");
addList("First-Select", "great job!", "", "greatjob");
addList("First-Select", "honeymoon", "", "honeymoon");
addList("First-Select", "just because", "", "justbecause");
addList("First-Select", "mother's day", "", "mothersday");
addList("First-Select", "romance", "", "romance");

addOption("girlsgetaway", "select guide", "", 1); //HEADER OPTION
addList("girlsgetaway", "by region", "girls_boston", "girls_dc", "girls_newyork", "girls_chicago");
addList("girlsgetaway", "where to weekend", "girls_boston", "girls_dc", "girls_newyork", "girls_chicago");
addList("girlsgetaway", "- d.c.", "", "girls_dc");
addList("girlsgetaway", "- boston.", "", "girls_boston");
addList("girlsgetaway", "- new york", "", "girls_newyork");
addList("girlsgetaway", "- chicago", "", "girls_chicago");
addList("girlsgetaway", "by interest", "", "girls_dc");
addList("girlsgetaway", "- 1000 places to see", "", "girls_dc");
addList("girlsgetaway", "- spa escapes", "", "girls_spa");
addList("girlsgetaway", "- zagat spa & resorts", "", "");
addList("girlsgetaway", "- zagat golf", "", "");
addList("girlsgetaway", "- golf hideaways", "", "");
addList("girlsgetaway", "- romantic resorts", "", "romantic");

addOption("girls_boston", "select denomination", "", 1); //HEADER OPTION
addOption("girls_boston50", "$50", "http://weekendsaway.com/store/product_info.php?products_id=29");
addOption("girls_boston100", "$100", "http://weekendsaway.com/store/product_info.php?products_id=30");
addOption("girls_boston250", "$250", "http://weekendsaway.com/store/product_info.php?products_id=31");
addOption("girls_boston500", "$500", "http://weekendsaway.com/store/product_info.php?products_id=32");

addOption("girls_chicago", "select denomination", "", 1); //HEADER OPTION
addOption("girls_chicago50", "$50", "http://weekendsaway.com/store/product_info.php?products_id=37");
addOption("girls_chicago100", "$100", "http://weekendsaway.com/store/product_info.php?products_id=38");
addOption("girls_chicago250", "$250", "http://weekendsaway.com/store/product_info.php?products_id=39");
addOption("girls_chicago500", "$500", "http://weekendsaway.com/store/product_info.php?products_id=40");

addOption("girls_dc", "select denomination", "", 1); //HEADER OPTION
addOption("girls_dc50", "$50", "http://weekendsaway.com/store/product_info.php?products_id=33");
addOption("girls_dc100", "$100", "http://weekendsaway.com/store/product_info.php?products_id=34");
addOption("girls_dc250", "$250", "http://weekendsaway.com/store/product_info.php?products_id=35");
addOption("girls_dc500", "$500", "http://weekendsaway.com/store/product_info.php?products_id=36");

addOption("girls_newyork", "select denomination", "", 1); //HEADER OPTION
addOption("girls_newyork50", "$50", "http://weekendsaway.com/store/product_info.php?products_id=41");
addOption("girls_newyork100", "$100", "http://weekendsaway.com/store/product_info.php?products_id=42");
addOption("girls_newyork250", "$250", "http://weekendsaway.com/store/product_info.php?products_id=43");
addOption("girls_newyork500", "$500", "http://weekendsaway.com/store/product_info.php?products_id=44");

ddadmin
03-09-2005, 09:24 PM
Firstly, please reinstate the copyright notice that should appear inside the <script> tag of this script:

/***********************************************
* 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
***********************************************/

Otherwise, this is in violation of our usage terms.

From what I can tell the HTML for your "go" button is incorrect:

<input type="submit" value="Go" onclick="goTo(goListGroup(document.listmenu0.firstlevel, document.listmenu0.secondlevel, document.listmenu0.thirdlevel)"

it should be:

<input type="button" value="Go" onclick="goTo(goListGroup(document.listmenu0.firstlevel, document.listmenu0.secondlevel, document.listmenu0.thirdlevel)">

Notice the change from "submit" to "button", and the closing ">" at the end of the tag.