Double Jump Menu. Options Dont Appear ? Code help please

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.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack (2) Thread Tools
  2 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old May 10th, 2005, 10:00
Reputable Member
Join Date: May 2005
Location: Sheffield
Posts: 104
Thanks: 0
Thanked 0 Times in 0 Posts
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>
Reply With Quote

  #2 (permalink)  
Old Jun 20th, 2005, 20:44
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
Still need help with this?
Reply With Quote
Reply

Tags
double, jump, menu, options, appear, code, help

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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


All times are GMT. The time now is 00:06.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43