...

View Full Version : get data from hidden field



tensio
08-30-2004, 10:56 PM
Hi -
I have a dhtml menu in an external file (mainmenu.js). I want the menu to get a value (session id) from a hidden field in the footer of the html/php page the menu is on and include it on the menu links. I've included the mainmenu code below... how do I get the value so that I can use it in the links (as the "osCsid")? THanks!



//----------DHTML Menu Created using AllWebMenus PRO ver 3.1-#508---------------
var awmMenuName='mainmenu';
var awmLibraryPath='/awmData-mainmenu';
var awmImagesPath='/awmData-mainmenu';
var awmSupported=(navigator.appName + navigator.appVersion.substring(0,1)=="Netscape5" || document.all || document.layers || navigator.userAgent.indexOf('Opera')>-1)?1:0;
if (awmAltUrl!='' && !awmSupported) window.location.replace(awmAltUrl);
if (awmSupported){
var awmMenuPath;
if (document.all) mpi=document.all['awmMenuPathImg-mainmenu'].src;
if (document.layers) mpi=document.images['awmMenuPathImg-mainmenu'].src;
if (navigator.appName + navigator.appVersion.substring(0,1)=="Netscape5" || navigator.userAgent.indexOf('Opera')>-1) mpi=document.getElementById('awmMenuPathImg-mainmenu').src;
awmMenuPath=mpi.substring(0,mpi.length-16);
var nua=navigator.userAgent,scriptNo=(nua.indexOf('Safari')>-1)?7:(nua.indexOf('Gecko')>-1)?2:((document.layers)?3:((nua.indexOf('Opera')>-1)?4:((nua.indexOf('Mac')>-1)?5:((nua.indexOf('Konqueror')>-1)?6:1))));
document.write("<SCRIPT SRC='"+awmMenuPath+awmLibraryPath+"/awmlib"+scriptNo+".js'><\/SCRIPT>");
var n=null;
awmzindex=1000;
}

var awmSubmenusFrame='';
var awmSubmenusFrameOffset;
var awmOptimize=0;
function awmBuildMenu(){
if (awmSupported){
awmImagesColl=['ecomm_07.gif',146,30,'ecomm_over_07.gif',146,30,'ecomm_09.gif',146,29,'ecomm_over_09.gif',146,29,'e comm_10.gif',146,29,'ecomm_over_10.gif',146,29,'ecomm_11.gif',146,29,'ecomm_over_11.gif',146,29,'eco mm_12.gif',146,29,'ecomm_over_12.gif',146,29,'ecomm_13.gif',146,30,'ecomm_over_13.gif',146,30,'ecomm _14.gif',146,29,'ecomm_over_14.gif',146,29,'ecomm_15.gif',146,29,'ecomm_over_15.gif',146,29,'ecomm_1 6.gif',146,28,'ecomm_over_16.gif',146,28,'ecomm_17.gif',146,31,'ecomm_over_17.gif',146,31];
awmCreateCSS(1,2,1,'#FFFFFF','#0055E5',n,'14px sans-serif',n,'none',0,n,0,4)
awmCreateCSS(0,1,0,n,'#000000',n,n,n,'outset',0,'#C0C0C0',0,0);
awmCreateCSS(1,2,1,'#000000','#FFFFFF',n,'14px sans-serif',n,'none',1,n,0,1)
awmCreateCSS(0,2,1,'#FFFFFF','#7A96DF',n,'14px sans-serif',n,'none',1,n,0,1)
awmCreateCSS(1,2,1,'#000000','#FE7013',n,'14px sans-serif',n,'none',1,n,0,0)
awmCreateCSS(0,1,0,n,'#C41200',n,n,n,'solid',1,'#C41200',0,0);
awmCreateCSS(1,2,0,'#000000','#FE7013',n,'10px sans-serif',n,'solid',0,'#000000',2,1)
awmCreateCSS(0,2,0,'#000000','#F7FB74',n,'10px sans-serif',n,'solid',0,'#000000',2,1)
var s0=awmCreateMenu(0,0,0,0,1,0,0,0,0,30,30,0,0,1,0,n,"",n,1,0,1,0,n,n,100);
it=s0.addItemWithImages(2,3,3,"","","","",0,1,n,0,0,0,n,n,n,"",n,n,n,"http://4keywestfun.com/store/index.php?cPath=21",n);
var s1=it.addSubmenu(0,0,-13,2,0,0,0,5,4,n,"",n,1,1,1,1,n,n,100);
it=s1.addItem(6,7,7,"&nbsp;&nbsp;OFFSHORE&nbsp;&nbsp;",n,n,"","",n,n,n,"http://4keywestfun.com/store/index.php?cPath=21_31&osCsid=3577de9804aa9fd60d9bcabe04fc17b2",n);
it=s1.addItem(6,7,7,"&nbsp;&nbsp;REEF/WRECK&nbsp;&nbsp;",n,n,"","",n,n,n,"http://4keywestfun.com/store/index.php?cPath=21_33&osCsid=3577de9804aa9fd60d9bcabe04fc17b2",n);
it=s1.addItem(6,7,7,"&nbsp;&nbsp;FLATS&nbsp;&nbsp;",n,n,"","",n,n,n,"http://4keywestfun.com/store/index.php?cPath=21_32&osCsid=3577de9804aa9fd60d9bcabe04fc17b2",n);
it=s1.addItem(6,7,7,"&nbsp;&nbsp;SPLIT-CHARTER&nbsp;&nbsp;",n,n,"","",n,n,n,"http://4keywestfun.com/store/index.php?cPath=21_34&osCsid=3577de9804aa9fd60d9bcabe04fc17b2",n);
it=s0.addItemWithImages(2,3,3,"","","","",2,3,n,0,0,0,n,n,n,"",n,n,n,"http://4keywestfun.com/store/index.php?cPath=22",n);
var s1=it.addSubmenu(0,0,-13,2,0,0,0,5,4,n,"",n,1,1,1,1,n,n,100);
it=s1.addItem(6,7,7,"&nbsp;&nbsp;DIVE TRIPS&nbsp;&nbsp;",n,n,"","",n,n,n,"http://4keywestfun.com/store/product_info.php?cPath=22&products_id=32",n);
it=s1.addItem(6,7,7,"&nbsp;&nbsp;CERTIFICATION&nbsp;&nbsp;",n,n,"","",n,n,n,"http://4keywestfun.com/store/product_info.php?cPath=22&products_id=30",n);
it=s1.addItem(6,7,7,"&nbsp;&nbsp;DIVE IN A DAY&nbsp;&nbsp;",n,n,"","",n,n,n,"http://4keywestfun.com/store/product_info.php?cPath=22&products_id=31",n);
it=s1.addItem(6,7,7,"&nbsp;&nbsp;SNUBA&nbsp;&nbsp;",n,n,"","",n,n,n,"http://4keywestfun.com/store/product_info.php?cPath=22&products_id=33",n);
it=s0.addItemWithImages(2,3,3,"","","","",4,5,n,0,0,0,n,n,n,"",n,n,n,"http://4keywestfun.com/store/index.php?cPath=23",n);
var s1=it.addSubmenu(0,0,-13,2,0,0,0,5,4,n,"",n,1,1,1,1,n,n,100);
it=s1.addItem(6,7,7,"&nbsp;&nbsp;YANKEE FREEDOM&nbsp;&nbsp;",n,n,"","",n,n,n,"http://4keywestfun.com/store/product_info.php?cPath=23&products_id=39&osCsid=$osCsid",n);
it=s1.addItem(6,7,7,"&nbsp;&nbsp;SUNNY DAYS&nbsp;&nbsp;",n,n,"","",n,n,n,"http://4keywestfun.com/store/product_info.php?cPath=23&products_id=38",n);
it=s1.addItem(6,7,7,"&nbsp;&nbsp;SEAPLANES OF KEY WEST&nbsp;&nbsp;",n,n,"","",n,n,n,"http://4keywestfun.com/store/product_info.php?cPath=23&products_id=37",n);
it=s0.addItemWithImages(2,3,3,"","","","",6,7,n,0,0,0,n,n,n,"",n,n,n,"http://4keywestfun.com/store/index.php?cPath=24",n);
var s1=it.addSubmenu(0,0,-13,2,0,0,0,5,4,n,"",n,1,1,1,1,n,n,100);
it=s1.addItem(6,7,7,"&nbsp;&nbsp;SNORKEL ADVENTURE&nbsp;&nbsp;",n,n,"","",n,n,n,"http://4keywestfun.com/store/product_info.php?cPath=24&products_id=48&osCsid='tep_session_id()'",n);
it=s1.addItem(6,7,7,"&nbsp;&nbsp;POWERED CATAMARAN SNORKELING&nbsp;&nbsp;",n,n,"","",n,n,n,"http://4keywestfun.com/store/product_info.php?cPath=24&products_id=47",n);
it=s1.addItem(6,7,7,"&nbsp;&nbsp;STARS & STRIPES&nbsp;&nbsp;",n,n,"","",n,n,n,"http://4keywestfun.com/store/product_info.php?cPath=24&products_id=50",n);
it=s1.addItem(6,7,7,"&nbsp;&nbsp;DOLPHIN/GLASS BOTTOM & SNORKEL TRIP&nbsp;&nbsp;",n,n,"","",n,n,n,"http://4keywestfun.com/store/product_info.php?cPath=24&products_id=46",n);
it=s1.addItem(6,7,7,"&nbsp;&nbsp;SNUBA&nbsp;&nbsp;",n,n,"","",n,n,n,"http://4keywestfun.com/store/product_info.php?cPath=24&products_id=49",n);
it=s0.addItemWithImages(2,3,3,"","","","",8,9,n,0,0,0,n,n,n,"",n,n,n,"http://4keywestfun.com/store/index.php?cPath=25",n);
var s1=it.addSubmenu(0,0,-13,2,0,0,0,5,4,n,"",n,1,1,1,1,n,n,100);
it=s1.addItem(6,7,7,"&nbsp;&nbsp;DOLPHIN/GLASS BOTTOM & SNORKEL TRIP&nbsp;&nbsp;",n,n,"","",n,n,n,"http://4keywestfun.com/store/product_info.php?cPath=25&products_id=34",n);
it=s1.addItem(6,7,7,"&nbsp;&nbsp;WILD DOLPHIN ENCOUNTER&nbsp;&nbsp;",n,n,"","",n,n,n,"http://4keywestfun.com/store/product_info.php?cPath=25&products_id=36",n);
it=s1.addItem(6,7,7,"&nbsp;&nbsp;INTERACT WITH WILD DOLPHINS&nbsp;&nbsp;",n,n,"","",n,n,n,"http://4keywestfun.com/store/product_info.php?cPath=25&products_id=35",n);
it=s0.addItemWithImages(2,3,3,"","","","",10,11,n,0,0,0,n,n,n,"",n,n,n,"http://4keywestfun.com/store/index.php?cPath=26",n);
var s1=it.addSubmenu(0,0,-13,2,0,0,0,5,4,n,"",n,1,1,1,1,n,n,100);
it=s1.addItem(6,7,7,"&nbsp;&nbsp;SAIL, SNORKEL, AND KAYAK&nbsp;&nbsp;",n,n,"","",n,n,n,"http://4keywestfun.com/store/product_info.php?cPath=26&products_id=45",n);
it=s1.addItem(6,7,7,"&nbsp;&nbsp;ISLAND TING&nbsp;&nbsp;",n,n,"","",n,n,n,"http://4keywestfun.com/store/product_info.php?cPath=26&products_id=44",n);
it=s1.addItem(6,7,7,"&nbsp;&nbsp;BACK COUNTRY SAFARI&nbsp;&nbsp;",n,n,"","",n,n,n,"http://4keywestfun.com/store/product_info.php?cPath=26&products_id=43",n);
it=s0.addItemWithImages(2,3,3,"","","","",12,13,n,0,0,0,n,n,n,"",n,n,n,"http://4keywestfun.com/store/index.php?cPath=27",n);
var s1=it.addSubmenu(0,0,-13,2,0,0,0,5,4,n,"",n,1,1,1,1,n,n,100);
it=s1.addItem(6,7,7,"&nbsp;&nbsp;DO-IT-ALL&nbsp;&nbsp;",n,n,"","",n,n,n,"http://4keywestfun.com/store/product_info.php?cPath=27&products_id=28",n);
it=s1.addItem(6,7,7,"&nbsp;&nbsp;POWER ADVENTURE&nbsp;&nbsp;",n,n,"","",n,n,n,"http://4keywestfun.com/store/product_info.php?cPath=27&products_id=29",n);
it=s0.addItemWithImages(2,3,3,"","","","",14,15,n,0,0,0,n,n,n,"",n,n,n,"http://4keywestfun.com/store/index.php?cPath=29",n);
var s1=it.addSubmenu(0,0,-13,2,0,0,0,5,4,n,"",n,1,1,1,1,n,n,100);
it=s1.addItem(6,7,7,"&nbsp;&nbsp;WESTERN UNION&nbsp;&nbsp;",n,n,"","",n,n,n,"http://4keywestfun.com/store/product_info.php?cPath=29&products_id=54&osCsid=b9cb95f80303670db7b695827838a646",n);
it=s1.addItem(6,7,7,"&nbsp;&nbsp;APPLEDORE&nbsp;&nbsp;",n,n,"","",n,n,n,"http://4keywestfun.com/store/product_info.php?cPath=29&products_id=52&osCsid=b9cb95f80303670db7b695827838a646",n);
it=s1.addItem(6,7,7,"&nbsp;&nbsp;AMERICA&nbsp;&nbsp;",n,n,"","",n,n,n,"http://4keywestfun.com/store/product_info.php?cPath=29&products_id=51&osCsid=b9cb95f80303670db7b695827838a646",n);
it=s1.addItem(6,7,7,"&nbsp;&nbsp;SEBAGO CATAMARANS&nbsp;&nbsp;",n,n,"","",n,n,n,"http://4keywestfun.com/store/product_info.php?cPath=29&products_id=53&osCsid=b9cb95f80303670db7b695827838a646",n);
it=s0.addItemWithImages(2,3,3,"","","","",16,17,n,0,0,0,n,n,n,"",n,n,n,"http://4keywestfun.com/store/index.php?cPath=30",n);
var s1=it.addSubmenu(0,0,-13,2,0,0,0,5,4,n,"",n,1,1,1,1,n,n,100);
it=s1.addItem(6,7,7,"&nbsp;&nbsp;PRIDE OF KW&nbsp;&nbsp;",n,n,"","",n,n,n,"http://4keywestfun.com/store/product_info.php?cPath=30&products_id=42&osCsid=9149ec8f9a49c2d1737f3c78a2b362ae",n);
it=s1.addItem(6,7,7,"&nbsp;&nbsp;DISCOVERY&nbsp;&nbsp;",n,n,"","",n,n,n,"http://4keywestfun.com/store/product_info.php?cPath=30&products_id=40&osCsid=9149ec8f9a49c2d1737f3c78a2b362ae",n);
it=s1.addItem(6,7,7,"&nbsp;&nbsp;FROGGIES&nbsp;&nbsp;",n,n,"","",n,n,n,"http://4keywestfun.com/store/product_info.php?cPath=30&products_id=41&osCsid=9149ec8f9a49c2d1737f3c78a2b362ae",n);
it=s0.addItemWithImages(2,3,3,"","","","",18,19,n,0,0,0,n,n,n,"",n,n,n,"http://4keywestfun.com/store/index.php?cPath=28",n);
var s1=it.addSubmenu(0,0,-13,2,0,0,0,5,4,n,"",n,1,1,1,1,n,n,100);
it=s1.addItem(6,7,7,"&nbsp;&nbsp;JET-SKI ISLAND TOUR&nbsp;&nbsp;",n,n,"","",n,n,n,"http://4keywestfun.com/store/product_info.php?cPath=28&products_id=55&osCsid=c397f37d2e4ea9e752cdf9fe5b29c83c",n);
it=s1.addItem(6,7,7,"&nbsp;&nbsp;SPEED BOAT ADVENTURE&nbsp;&nbsp;",n,n,"","",n,n,n,"http://4keywestfun.com/store/product_info.php?cPath=28&products_id=57&osCsid=c397f37d2e4ea9e752cdf9fe5b29c83c",n);
it=s1.addItem(6,7,7,"&nbsp;&nbsp;PARASAILING&nbsp;&nbsp;",n,n,"","",n,n,n,"http://4keywestfun.com/store/product_info.php?cPath=28&products_id=56&osCsid=c397f37d2e4ea9e752cdf9fe5b29c83c",n);
it=s1.addItem(6,7,7,"&nbsp;&nbsp;BOAT RENTALS&nbsp;&nbsp;",n,n,"","",n,n,n,"http://4keywestfun.com/store/product_info.php?cPath=28&products_id=58&osCsid=c397f37d2e4ea9e752cdf9fe5b29c83c",n);
s0.pm.buildMenu();
}}

Roy Sinclair
08-31-2004, 04:07 PM
You have to pick it up in a "onload" event handler or make sure your menu script is loaded into the page AFTER the hidden field is loaded. Either way, the key is that your script has to pick it up after it's been added to the page and the value is therefore available.

Oh yeah, look for a different menu when you can. That particular menu is slow in initializing itself making it seem like your pages take a lot longer to load than they really do.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum