Dynamic Drop Down Menu

Hello,

I have a coded two drop down boxes which pull information from a MySQL database. I am currently using a javascript jump menu to refresh the page, which then generates the second drop down box (based on the selection in the first drop down box). My question is that when the page refreshes all my previous data is lost. This might be a question for a java script person, but do you know of any way in which I can retain my values within the rest of my form? Any suggestions would be great! Thanks

Here is the jump menu code I am using:

[code][/code]

and the drop down box SQL code

[code]
Select

<?php // Get the Categories from Database if (!isset($type_array)){ $type_array=get_category_name(); $query = "SELECT Type_ID, Type_Name FROM Instance_Type111"; $query_result=@mysql_query($query,$mysql_link) or die ('Could not get categories!
n'); $type_array = db_result_to_array($query_result); } // Display Categories in the menu listing $mi=1; foreach ($type_array as $row){ $Type_ID= (string) $row['Type_ID']; $Type_Name= $row['Type_Name']; if ($mi!=$mind){ print ("$Type_Name"); } else { print ("$Type_Name"); } $mi++; } // Setting the main category code // $mcate_code is the maincat_id of main category chosen if(!isset($HTTP_GET_VARS['mcate'])) { $mcade_code = 0; } else{ $mcade_code = $HTTP_GET_VARS['mcate']; } ?>
  			</tr>
Detailed Incident Type: Select <?php //Get Detailed Definition from Database $type_array=get_categories($mcade_code); // Display Categories in the menu listing display_category($type_array);

// Setting the main category code
// $cate_code is the maincat_id of main category chosen
if(!isset($HTTP_GET_VARS[‘cate’])) {
$icade_code = 0;
} else{
$icade_code = $HTTP_GET_VARS[‘cate’];
}
?>


[/code]

Thanks

Sponsor our Newsletter | Privacy Policy | Terms of Service