• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 290
  • Last Modified:

Java code modify

The Java code below was originally used with frames. The dropdown menu in the left frame changed the page in the right frame. I need to modify the Java code so that when a slection is made from the menu it displys the page on the same page. I believe mainFrame is what needs to be changed.
Here is the code -

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<Script language="JavaScript"><!--
function jumpMenu(targ,selObj,restore){
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//--></Script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>bsd_select.php</title>
</head>
<body>
<form>
    Search the Database <br>
    <select style="width:125px" name="menu1" onChange="jumpMenu('parent.mainFrame',this,0)"><option>Make a Selection</option>
    <?php
      $include_path = "";
      require_once($include_path. 'uis.php');
      require_once($include_path. 'myconfig.php');

     $i=0;
     $j=0;

// $result = mysql_query("SELECT DISTINCT ministryID, ministry_name, ministry_link FROM ".$myconfig->dt['ministries']." ORDER BY ministry_name ASC") or die("Sql error : " . mysql_error());
$result = mysql_query("SELECT DISTINCT jz_directoryID, action_name, directory_link FROM ".$myconfig->dt['jz_directory']." ORDER BY action_name ASC") or die("Sql error : " . mysql_error());

while ($row = mysql_fetch_array($result)) {
echo "<option value=\"{$row['directory_link']}?id={$row['jz_directoryID']}\">".$row["action_name"]."</option>\n";
     }

?>
    </select>
</form>

<?php
?>
</body>
</html>

Thanks
Michael
0
mhoggatt1
Asked:
mhoggatt1
1 Solution
 
hieloCommented:
The complete code is as follows:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<Script language="JavaScript"><!--
function jumpMenu(targ,selObj,restore){
if(selObj.selectedIndex>0)
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//--></Script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>bsd_select.php</title>
</head>
<body>
<form>
    Search the Database <br>
    <select style="width:125px" name="menu1" onChange="jumpMenu('top',this,0)"><option>Make a Selection</option>
    <?php
      $include_path = "";
      require_once($include_path. 'uis.php');
      require_once($include_path. 'myconfig.php');

     $i=0;
     $j=0;

// $result = mysql_query("SELECT DISTINCT ministryID, ministry_name, ministry_link FROM ".$myconfig->dt['ministries']." ORDER BY ministry_name ASC") or die("Sql error : " . mysql_error());
$result = mysql_query("SELECT DISTINCT jz_directoryID, action_name, directory_link FROM ".$myconfig->dt['jz_directory']." ORDER BY action_name ASC") or die("Sql error : " . mysql_error());

while ($row = mysql_fetch_array($result)) {
echo "<option value=\"{$row['directory_link']}?id={$row['jz_directoryID']}\">".$row["action_name"]."</option>\n";
     }

?>
    </select>
</form>

<?php
?>
</body>
</html>
0
 
mhoggatt1Author Commented:
Here you go, thanks again.
Michael
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now