PDA

View Full Version : Dropdown selection -> second dropdown



SysX
11-21-2005, 05:02 AM
Does anyone know of a way to execute an if (isset([])) function from a selection in a drpodown menu?

I have a dropdown menu that diaplays items from a database:



<?php
//Create dropdown criteria for relationship sub-category
$values = array ( );
$labels = array ( );
$query = "SELECT swcontti_id, descr FROM swcontti ORDER BY descr";
$result = $conn->issue_query ($query);
if ($result)
{
while (list ($swcontti_id, $descr) = mysql_fetch_row ($result))
{
$values[] = $swcontti_id;
$labels[] = $descr;
}
}

//Print SQL query results
print (make_popup_menu ("swcontti", $values, $labels, ""));
?>



I would like to be able to show a second dropdown from the selection of one item from this dropdown (swcontti).

Can anyone help me please?

Kind regards,

SysX

SysX
12-09-2005, 05:04 AM
The answer to this is you can't use anything in PHP that's like on select as it's serverside but you can do the obvious alternative:

Have a dropdown that if X is selected produce table X if
Y is selected produce Y, or create tabs instead...