Hi,
I have two dropdown boxes. Two boxes have values from two different tables. They dont have any common field to relate with.
I would like to display the values based on selecting the first combo box value.
If i select first combo box value, then automaticlly the second drop down box value should be changed.
<TD ALIGN="RIGHT" width=19%><B>Fruits:</B></TD>
<td><select name="fruit" size="1" class="text" tabindex="12" >
<?php
$fruitsql = mysql_query("SELECT * FROM fruits");
while ($fruitrow = mysql_fetch_array($fruitsql)) {
extract($fruittrow);
print "<option value=\"$fruit_id\">#$fruit_id $description</option>\n";
}
print "</select></td>";
?>
<TD ALIGN="RIGHT" width=19%><B>Vegetables:</B></TD>
<td><select name="veggies" size="1" class="text" tabindex="13" >
<?php
$productsql = mysql_query("SELECT * FROM vegetable WHERE veggiestatus='0' ORDER BY vegiepercent");
while ($productrow = mysql_fetch_array($productsql)) {
extract($productrow);
print "<option value=\"$veggie_id\">$veggiepercent% $definition</option>\n";
}
print "</select></td>";
?>
Fruits combobox, contains 9 values like, #1 Nofruits, #2 Apples, #3 Oranges, #4 strawberry,...
Vegetables combo box contains 5 values like 0% vitamin, 25% vitamins, 60% vitamins, 75% vitamins, 90% vitamins
If i select #1 Nofruits from Fruits combobox, then, it should show 0%vitamins alone.
If i select #2 Apples from Fruits combobox, then, it should show 25%vitamins alone.
If i select #3 Oranges from Fruits combobox, then, it should show 25%vitamins and 75% vitamins alone.
please help me with coding.
Thanks.