Can I use value in a list as a "control" key...?
Posted: Tue Apr 13, 2004 1:32 am
I have 2 fields in a table, Key and Description. I use a drop down list for keys (already dumped into an array), such as:
<?php
$list = "<SELECT NAME=\"$mylist\">";
$list .= "<OPTION VALUE=\"\">Select...</OPTION>";
for($i = 1; $i<n; $i++)
{
$list .= "<OPTION VALUE=\"$key[$i]\"";
$list .= ">$key[$i]</OPTION>";
}
$list .= "</SELECT>\n";
print $list;
?>
What I want to do next is to have an text editing box for ONE Description, depends on the key that is chosen from the above drop down list. Sounds simple, but I cannot get it to work right. Can anyone provide a code example? Thanks much.
<?php
$list = "<SELECT NAME=\"$mylist\">";
$list .= "<OPTION VALUE=\"\">Select...</OPTION>";
for($i = 1; $i<n; $i++)
{
$list .= "<OPTION VALUE=\"$key[$i]\"";
$list .= ">$key[$i]</OPTION>";
}
$list .= "</SELECT>\n";
print $list;
?>
What I want to do next is to have an text editing box for ONE Description, depends on the key that is chosen from the above drop down list. Sounds simple, but I cannot get it to work right. Can anyone provide a code example? Thanks much.