Connecting Tech Pros Worldwide Help | Site Map

Dynamic menus

  #1  
Old July 17th, 2005, 02:08 AM
Jim F
Guest
 
Posts: n/a
I did not include my question in the previous message

I have taken this from another example I saw of where one drop down
list is dependent on the selection of the previous. I can't get the
data to show up in the second menu after I select the first. Anyone
see what I am doing wrong?

Thanks, Jim

<?php
include('./common_db.inc');
$link_id = db_connect();
mysql_select_db("test_aces_data");
?>

<form name=carform action=
<?php echo $_SERVER['PHP_SELF'];
?> method=post>
<?php


$query =mysql_query("select DISTINCT CQ_PROD_PLATFORM AS make_id from
CQ_data ORDER BY make_id");
echo '<select name=make
onchange="document.carform.submit()"'.">"."\n";
if (!isset($make))
{
echo '<option value=null selected>Choose a Make</option>'."\n";
}
while(list($make_id) = mysql_fetch_row($query))
{
echo '<option value='.$make_id;
if (isset($make)&& $make_id == $make)
{
echo " selected";
}
echo '>'."$make_id".'</option>'."\n";
}
echo '</select>'."\n";
echo '<select name=model
onchange="document.carform.submit()"'.">"."\n";
if (!isset($make))
{
echo '<option value=null selected>Choose a Make First</option>'."\n";
}
else
{
$result = mysql_query("select DISTINCT CQ_SUBSYSTEM AS name from
CQ_data where make_id='$make' ORDER BY NAME");
echo '<option value=null selected>Choose a Model</option>'."\n";
while(list($model_id) = mysql_fetch_row($result))
{
echo '<option value=' . $model_id;
if ($model_id == $model)
{
echo " selected";
}
echo '>$model_id</option>'."\n";
}
} echo '</select>'."\n";
?>
  #2  
Old July 17th, 2005, 02:39 AM
steef
Guest
 
Posts: n/a

re: Dynamic menus


Jim~

I'm working on a similar problem with dependent dropdowns in php, and
I'm curious if you ever figured out why your second menu wasn't
populating? If you'd share your solution I'd be grateful. Thanks!
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
VB6 Dynamic Menus from SQL Server Table cwhiteau answers 0 February 7th, 2008 06:47 PM
Dynamic menus tonFrere answers 8 December 21st, 2006 07:15 PM
Dynamic Menus with Events Stan Smith answers 3 February 1st, 2006 12:05 PM
Dynamic Menus tma answers 2 November 18th, 2005 03:14 PM
Dynamic Menus JMMB answers 0 November 15th, 2005 11:50 AM