/    Sign up×
Community /Pin to ProfileBookmark

Javascript dropdown from an array

I want to skip certain items in the array if I remove it it will show 0 any direction it is included in a classic asp page.

<SCRIPT LANGUAGE=”JavaScript1.1″>
<!– hide from old browsers

var numDDs = <%= (catTotal+1) %>;

var locs = new make2dArray (numDDs,2);

locs[1][1] = “Go to Page Number…”;
locs[1][2] = ” “;
locs[2][1] = “Table of Contents”;
locs[2][2] = “test.asp”;
locs[3][1] = “Pg 1 – test1”;
locs[3][2] = “index.asp?pgName=1”;
locs[4][1] = “Pg 2 – test2”;
locs[4][2] = “index.asp?pgName=2”;
locs[5][1] = “Pg 3 – test3”;
locs[5][2] = “index.asp?pgName=3”;
locs[6][1] = “Pg 4 – test4”;
locs[6][2] = “index.asp?pgName=4”;
locs[7][1] = “Pg 5 – test5”;
locs[7][2] = “index.asp?pgName=5”;
locs[8][1] = “Pg 6 – test6”;
locs[6][2] = “index.asp?pgName=4”;

function make2dArray (x,y) {

var count;

this.length = x;

for (var count = 1; count <= x; count++)
this[count] = new makeArray (y);
}

function makeArray(numElements) {

var Count;

this.length = numElements;

for (var Count = 1; Count <= numElements; Count++)

this[Count] = 0;

return (this);}

function gotoURL(form) {

var url = “”;

var item = form.list.selectedIndex;

if (item != -1) { url = locs[item+1][2]; }

if(item==0){return;}

parent.location = url;}

// –>
</SCRIPT>

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @Goinstrument 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.23,
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,
)...