This is a discussion on "Double Jump Menu. Options Dont Appear ? Code help please" within the JavaScript Forum section. This forum, and the thread "Double Jump Menu. Options Dont Appear ? Code help please are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Double Jump Menu. Options Dont Appear ? Code help please
|
||
| Notices |
![]() |
|
|
LinkBack (2) | Thread Tools |
|
|||
|
Double Jump Menu. Options Dont Appear ? Code help please
I am making Javascript Double Jump menu. Select a section from the left and relevent options appear in the right hand menu.
The select options are defined in Javascript, (not hard coded in the menus) but they dont appear in the menus. Im working from a book "usable Web Menus" so I dont understand everything in the code, but I have been through it as accurately as I can. Here is my code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> <script type="text/javascript" language="javascript"> <!-- var sectionNames=new Array("Spain", "Portugal"); var numSections=sectionNames.length; var pages=new Array (numSections); pages[0]=" "; pages[1]=new Array ( "Costa De La Luz", "Costa Del Sol", "Costa Blanca", "Almeria"); pages[2]=new Array ( "Algarve" ); var URLbits=self.location.href.split("/"); var currPage=URLbits[URLbits.length-1]; var currPageName=currPage.split(".")[0]; var flag=false function fillSections() { var j=1; for(var i=0;i<numSections;i++) { if(i!=0||currPageName!="index") { document.navForm.sectionMenu.options[j]=new Option (sectionNames[i],i); j++; } } } function fillPages(form) { var mySelectedIndex=form.sectionMenu.selectedIndex; if(form.sectionMenu.options[mySelectedIndex].text=="Locations") self.location.href="index.html"; else { var m=1 selectedSection=mySelectedIndex; if(currPageName ! = "index") selectedSelection-=1; for(var k=0;k<pages[selectedSection].length;k++) { var selectedPageName=pages[SelectedSection] [k]; var selectedFile=selectedPageName; if(selectedPageName.indexOf(" ")i=-1) selectedPageName=selectedPageName.split(" ") [1]; form.pageMenu.options[m]=new Option(selectedFile,selectedPageName); m++; } for(n=pages[selectedSection].length+1;n<9;n++) form.pageMenu.options[n]=new Option(" ", " "); flag=true; } } function goThere(form) { if(!flag) { form.pageMenu.options[0].selected=true; alert("Please select a section of the site."; form.sectionMenu.focus(); } else { var myValue=form.pageMenu.options [form.pageMenu.selectedIndex].value; if(myValue!=" ") self.location.href=myValue.toLowerCase()+".html"; } } //--> </script> </head> <body> <form name="navForm"> <select name="sectionMenu" onchange="fillPages(this.form);"> <option value=" " selected> [locations]</option> <option></option> <option></option> </select> <select name="pageMenu" onchange="goThere(this.form);"> <option value=" " selected> [choose Region]</option> <option></option> <option></option> </select> </form> </body> </html> |
|
|
![]() |
| Tags |
| double, jump, menu, options, appear, code, help |
| Thread Tools | |
|
|
LinkBacks (?)
LinkBack to this Thread: http://www.webforumz.com/javascript-forum/2264-double-jump-menu-options-dont-appear.htm
|
||||
| Posted By | For | Type | Date | |
| Pages tagged with | This thread | Refback | Feb 25th, 2007 18:45 | |
| Pages tagged with | This thread | Refback | Feb 25th, 2007 18:45 | |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [SOLVED] pagementation to jump menu | saltedm8 | PHP Forum | 19 | Jan 26th, 2008 21:22 |
| I'm going to jump right in... | Amelia | Introduce Yourself | 9 | Jul 22nd, 2007 23:50 |
| how to modify code for slide in menu | jiam | JavaScript Forum | 0 | May 20th, 2007 15:54 |
| Dont write HTML code | gibboap | Web Page Design | 1 | Nov 28th, 2006 14:21 |
| jump to marker using parameters | Smokie | Flash & Multimedia Forum | 5 | Jan 14th, 2005 08:39 |