# Help with jump menu

**URL:** <https://forum.kirupa.com/t/help-with-jump-menu/166852>\
**Category:** web dev\
**Created:** [October 23, 2005, 9:47am UTC](https://forum.kirupa.com/t/help-with-jump-menu/166852 "2005-10-23T09:47:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![paul\_ferrie](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@paul\_ferrie](https://forum.kirupa.com/u/paul_ferrie)\
**Post date:** [October 23, 2005, 9:47am UTC](https://forum.kirupa.com/t/help-with-jump-menu/166852/1 "2005-10-23T09:47:27Z")

</div>

Hi guys, First time poster here.

I have a 20+articles on my clients website:  
[http://www.scotlet.co.uk/jcb/index.html](http://www.scotlet.co.uk/jcb/index.html)

Iv’e been told that i have to do away with the frames. Each page is to hold it’s own navigation to the other pages.

As well as there being the 20+ static pages on the server i also have a backup database of all these articles as well. I thought i would use the database side to create a jump menu to nav between the pages rather than hand coding each page, plus there comes the problem when pages are added or deleted.

Here is what i have so far.

```php

<script type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
<form id="form1" name="form1" method="get" action="">
<?php
$result = mysql_query("select arTitle from scArticles");
if ($result) 
{
echo "<SELECT NAME='arTitle' onchange=\"MM_jumpMenu('parent',this,0)\">";
while ($myrow = mysql_fetch_array($result))
	 {
	 echo "<OPTION VALUE=\"".$myrow["arTitle"].".htm\">" . $myrow["arTitle"]." </OPTION> ";
	 }
echo "</SELECT>";
} 
?>
</form>

```

It works so far.

The problem that i am having is when the selected page loads. How do i set the menu to display the current page being viewed.

I know where i need to put the code, just dont know what to put.

```php

if(!empty($_POST['arTitle'])){
echo "<SELECT NAME='arTitle' onchange=\"MM_jumpMenu('parent',this,0)\">";
}else{
"<SELECT NAME='current page' onchange=\"MM_jumpMenu('parent',this,0)\">";
}

```

Any help very much appreciated.

Thanks  
Paul
