/    Sign up×
Community /Pin to ProfileBookmark

Loading of options affecting menu display?

Hey Everyone,

I am attempting to combine some javascripts in one file. Although I am not getting any errors as such, I am not getting the page behaviour that I expect either. Usually the menu used in this page works fine, however it will not display at all whilst ‘dynamic’ options are being used. It is not so much the javascript which is responsible for the ‘dynamic’ options, but is instead the onload method calls within the body of the document. If I exclude the onload calls the menu displays however the options are not right, and if I include the onload calls the opposite is true. Any suggestions regarding how I can get these two features to work together will be greatly appreciated.

Thanks

Regards

Davo

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>
<html>
<head>
<title>Search by Catalogue Page</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
<link href=”writingstyles.css” rel=”stylesheet” type=”text/css”>
<script type=”text/javascript” src=”positionernocolor.js”></script>
<script type=”text/javascript” src=”doiMenuDOM.js”></script>
<script type=”text/javascript” src=”menuconfig.js”></script>
<script type=”text/javascript”>
//<!–
var catalogue = new Array();

catalogue[0] = new Array(
‘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’);

catalogue[1] = new Array(
’39’,
’40’,
’41’,
’42’,
’43’,
’44’,
’45’,
’46’,
’47’,
’48’,
’49’,
’50’,
’51’,
’52’,
’53’,
’54’,
’55’,
’56’,
’57’,
’58’,
’60’,
’61’,
’62’,
’63’,
’64’,
’65’,
’66’,
’67’,
’68’,
’69’,
’70’,
’71’,
’72’,
’73’,
’74’,
’75’,
’76’,
’77’,
’78’);

catalogue[2] = new Array(
’79’,
’80’,
’81’,
’82’,
’83’,
’84’,
’85’,
’86’,
’87’,
’88’,
’89’,
’90’,
’91’,
’92’,
’93’,
’94’,
’95’,
’96’,
’97’,
’98’);

catalogue[3] = new Array(
‘100’,
‘101’,
‘102’,
‘103’,
‘104’,
‘105’,
‘106’,
‘107’,
‘108’,
‘109’,
‘110’,
‘111’,
‘112’,
‘113’,
‘114’,
‘115’,
‘116’,
‘117’,
‘118’,
‘119’,
‘120’,
‘121’,
‘122’,
‘123’,
‘124’,
‘125’,
‘126’,
‘127’,
‘128’);

function checkOptions()
{
dynamicOptions = true;
optionsLength = document.forms[‘showCataloguePage’].pageNumber.options.length – 1;
document.forms[‘showCataloguePage’].pageNumber.options[optionsLength] = null;
if(document.forms[‘showCataloguePage’].pageNumber.options[optionsLength])
{
dynamicOptions = false;
}
}

function generateOptions()
{
if(!dynamicOptions)
{
//alert(“Your browser does not support?”);
return;
}

var select1 = document.forms[‘showCataloguePage’].catalogueNoSelector;
var selectedItem = select1.options[select1.selectedIndex].value;

if(!selectedItem)
{
return;
}

var list = catalogue[selectedItem];
var select2 = document.forms[‘showCataloguePage’].pageNumber;
select2.options.length = 0;

for(i=0; i<list.length; i++)
{
select2.options[i] = new Option(list[i], list[i+1]);
}

}
//–>
</script>

</head>

<body onload=”checkOptions(), generateOptions();” onresize=”window.location.href = window.location.href;”>

<script type=”text/javascript”>
//<!–
fgsMenu.SetPosition(‘absolute’,0,0);
fgsMenu.SetType(‘float’);
fgsMenu.SetCorrection(0,0);
fgsMenu.SetCellSpacing(10);
fgsMenu.SetItemDimension(110,40);
fgsMenu.SetBackground(”,’../pictures/greenmarble.gif’,’repeat’,”);
fgsMenu.SetShadow(false);
fgsMenu.SetFont(‘verdana,arial,tahoma, serif’,’10pt’);
fgsMenu.SetItemBorder(2,’#85B211′,’solid’);
fgsMenu.SetItemText(‘#D5D500′,’center’,’bold’,”,”);
fgsMenu.SetItemTextHL(‘#773C00′,’center’,’bold’,”,”);
fgsMenu.SetItemBackground(‘#773C00’,”,”,”);
fgsMenu.SetItemBackgroundHL(‘#D5D500’,”,”,”);
fgsMenu.SetItemBorderTopHL(2,’#773C00′,’solid’);
fgsMenu.SetItemBorderRightHL(2,’#773C00′,’solid’);
fgsMenu.SetItemBorderBottomHL(2,’#773C00′,’solid’);
fgsMenu.SetItemBorderLeftHL(2,’#773C00′,’solid’);
fgsMenu.SetItemTextClick(‘#004000′,’center’,”,”,”);
fgsMenu.SetItemBackgroundClick(”,”,”,”);
fgsMenu.SetItemBorderTopClick(2,’#773c00′,’solid’);
fgsMenu.SetItemBorderRightClick(2,’#773c00′,’solid’);
fgsMenu.SetItemBorderBottomClick(2,’#773c00′,’solid’);
fgsMenu.SetItemBorderLeftClick(2,’#773c00′,’solid’);
fgsMenu.SetBorderTop(2,’#592D00′,’outset’);
fgsMenu.SetBorderRight(2,’#592D00′,’outset’);
fgsMenu.SetBorderBottom(2,’#592D00′,’outset’);
fgsMenu.SetBorderLeft(2,’#592D00′,’outset’);
fgsMenu.SetPopOnClick(false);

fgsMenu._pop.SetCorrection(0,0);
fgsMenu._pop.SetItemDimension(150,20);
fgsMenu._pop.SetPaddings(1);
fgsMenu._pop.SetBackground(‘#773C00’,”,”,”);
fgsMenu._pop.SetFont(‘verdana,arial,tahoma, serif’,’10pt’);
fgsMenu._pop.SetBorderTop(2,’#773c00′,’outset’);
fgsMenu._pop.SetBorderRight(2,’#773c00′,’outset’);
fgsMenu._pop.SetBorderBottom(2,’#773c00′,’outset’);
fgsMenu._pop.SetBorderLeft(2,’#773c00′,’outset’);
fgsMenu._pop.SetDelay(500);
fgsMenu._pop.SetItemBorder(2,’#006400′,’solid’);
fgsMenu._pop.SetItemText(‘#d5d500′,’left’,”,”,”);
fgsMenu._pop.SetItemTextHL(‘#773C00′,’left’,”,”,”);
fgsMenu._pop.SetItemBorderHL(2,’#006400′,’solid’);
fgsMenu._pop.SetItemPaddings(0);
fgsMenu._pop.SetItemPaddingsHL(0);
fgsMenu._pop.SetItemBackgroundHL(‘#D5D500’,”,”,”);
fgsMenu._pop.SetPadding(1,1,1,1);
fgsMenu.Build();

//–>
</script>

<div align=”center” id=”searchByPage”>
<table>
<form action=”” id=”showCataloguePage” method=”” name=”showCataloguePage”>
<tr align=”left”>
<td class=”green_georgia_subheading”><em>Show Page</em> quickly jumps to your catalogue page of interest</td>
</tr>
<tr align=”center”>
<td>
<table>
<tr align=”left”>
<td>
<table>
<tr align=”left”>
<td><img src=”../pictures/light2.gif” width=”51″ height=”51″></td>
<td>
<ul>
<li class=”brown_verdana_text”>Select a catalogue of interest by clicking on the box below</li>
</ul>
</td>
</tr>
</table>
</td>
</tr>
<tr align=”center”>
<td>
<span class=”black_verdana_text”>Catalogue
<select class=”black_verdana_text” id=”catalogueNoSelector” name=”catalogueNoSelector” onchange=”generateOptions()”>
<option value=”0″>1</option>
<option value=”1″>2</option>
<option value=”2″>3</option>
<option value=”3″>4</option>
</select>
selected</span>
</td>
</tr>
<tr align=”center”>
<td>&nbsp;</td>
</tr>
<tr align=”left”>
<td>
<table>
<tr align=”left”>
<td><img src=”../pictures/light2.gif” width=”51″ height=”51″></td>
<td>
<ul>
<li class=”brown_verdana_text”>Select a catalogue page of interest by clicking on the box below</li>
</ul>
</td>
</tr>
</table>
</td>
</tr>
<tr align=”center”>
<td>
<span class=”black_verdana_text”>Page
</span>
<select class=”black_verdana_text” id=”pageNumber” name=”pageNumber”>
<option>&nbsp;</option>
</select>
<span class=”black_verdana_text”>
selected
</span>
</td>
</tr>
<tr align=”center”>
<td>&nbsp;</td>
</tr>
<tr align=”left”>
<td>
<table>
<tr align=”left”>
<td><img src=”../pictures/light2.gif” width=”51″ height=”51″></td>
<td>
<ul>
<li class=”brown_verdana_text”>Click Show Page to show all craft stamps on your catalogue page of interest</li>
</ul>
</td>
</tr>
</table>
</td>
</tr>
<tr align=”center”>
<td>
<input name=”showPage” type=”submit” class=”black_verdana_text” id=”showPage” value=”Show Page”>
</td>
</tr>
</table>
</td>
</tr>
<form>
</table>
</div>
<script type=”text/javascript”>
setElement(‘searchByPage’, 20, 1, 101, 57, 1);
</script>
</body>
</html>

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @3D_Dog_Man spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...