[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Java code modify

Posted on 2007-10-19
2
Medium Priority
?
282 Views
Last Modified: 2013-11-23
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
Comment
Question by:mhoggatt1
2 Comments
 
LVL 82

Accepted Solution

by:
hielo earned 1000 total points
ID: 20119422
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
 

Author Comment

by:mhoggatt1
ID: 20119817
Here you go, thanks again.
Michael
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses
Course of the Month18 days, 14 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question