Jump Menu Help

He has: 5 posts

Joined: Dec 2004

Can someone please tell me how to add content to this code?
I want to add links to all of my pages in this menu.

<!--Start JumpMenu -->

<select name="entry" class="select">
<option value="0" selected>Guestbook</option>
</select>
<input type="submit" value="Go" class="input">

<!--End JumpMenu -->
'

thanks in advance.

"I plan on living forever...So far so good!

CptAwesome's picture

He has: 370 posts

Joined: Dec 2004

<!--Start JumpMenu -->
<form name="formname">

<select name="entry" class="select">
<option value="guestbook.html" selected>Guestbook</option>
<option value="whatever.html">Whatever</option>
<option value="page1.html">Title of page 1</option>
</select>

<a href="javascript:window.location = formname.entry.value;">Go</a>

<!--End JumpMenu -->
'

Though you might have to make the links absolute (http://www.domain.tld/whatever.html)

if you want to get a little fancy, and if you're lazy, you might want to use some Server Side stuff, and make a loop (simple php loop)

<!--Start JumpMenu -->
<form name="formname">

<select name="entry" class="select">
<!--Start PHP code -->
<?
/*
To add new links, add a new item to $links, and $names
*/
$links = array('guestbook.html','whatever.html','page1.html');
$names = array('Guestbook','Whatever','Title of page 1');
while($x < count($links))
{
echo "<option value=\"http://www.domain.tld/".$links[$x]."\">".$names[$x]."</option>";
$x++;
}
?>
<!--End PHP code -->

</select>

<a href="javascript:window.location = formname.entry.value;">Go</a>

<!--End JumpMenu -->
'

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.