PDA

View Full Version : Chained menu targeting frame



kitten2781
01-30-2007, 06:16 PM
This is similar to the post "Chained Select Menu URL target" except that I have a list of items, but I want only some of the items to open in an outer frame, not the same frame and not all of the items in the select menus.

The drop down is in the iframe and I want 1 selection in the drop down to open in the mainFrame (main window, not in the iframe). I am using the DD Chained Selects Scripts but with 2 drop downs, not 3. I don't have any customized code in it other than the link to the page and the text in the drop downs (plus removing a menu).

Can someone walk me through what I need to add to the options that need a different target?


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="goto" //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", "Select product type", "", 0); //HEADER OPTION
addList("First-Select", "Item One", "", "ItemOne");
addList("First-Select", "Item Two", "", "ItemTwo");


addOption("ItemOne", "Select product model", 0); //HEADER OPTION
addOption("ItemOne", "List One", "listone.shtml");
addOption("ItemOne", "List Two", "listtwo.shtml");

addOption("ItemTwo", "Select product model", 0); //HEADER OPTION
addOption("ItemTwo", "List One", "listone2.shtml");
addOption("ItemTwo", "List Two", "listtwo2.shtml");


The chainedmenu.js file is unchanged.


Thank you in advance.
Am

Bluesplayer
12-21-2007, 10:14 PM
Hi

I had this problem too and the solution was very easy. If you open up chainedmenu.js there is a line there that reads like this (close to the top of the file)


window.location=selectedOptionvalue

Just alter it to read like this:


window.top.location=selectedOptionvalue

That will load a window on top and you can then use the menu inside an iframe. You can see mine working here:

http://bluesplayer.co.uk/daoc

All the links will be in place soon but for now only Albion links are working.

Regards
Bluesplayer