Hello there,
I am trying to create two dropdown menus in one of my forms so that they behave in the following way:
the first menu consists of "categories " of items, which I hard coded into the form. i am looking to relate the second menu with the first one such that, as soon as you choose an option from the first menu, the second menu lists only the name of those items that falls in the "category" chosen in the first menu.
I have a table set up with the data. The name of the table is items and the two fields are itemName and itemCategory.
Please help me out in sorting this problem. I have tried many things but the first thing that I am already unable to do is to make the first menu respond immediately without a need to press a button "automatic" .
the only bit of code that i have so far:
[html]
<tr>
<td width = "50" ><select name="category" >
<option value="1">appet izer </option>
<option value="2">meat and fish</option>
<option value="3">soup </option>
<option value="4">salad </option>
<option value="5">veget arian </option>
<option value="6">desse rt </option>
<option value="7">cold drinks </option>
<option value="8">hot drinks </option>
</select></td>
</tr>
<!--row 3-->
<tr>
<td width = "80" align = "right"> Item Name </td>
<td width = "50"><selec t name="items">
<option value="1">wings </option>
</select></td>
</tr>
[/html]
I am trying to create two dropdown menus in one of my forms so that they behave in the following way:
the first menu consists of "categories " of items, which I hard coded into the form. i am looking to relate the second menu with the first one such that, as soon as you choose an option from the first menu, the second menu lists only the name of those items that falls in the "category" chosen in the first menu.
I have a table set up with the data. The name of the table is items and the two fields are itemName and itemCategory.
Please help me out in sorting this problem. I have tried many things but the first thing that I am already unable to do is to make the first menu respond immediately without a need to press a button "automatic" .
the only bit of code that i have so far:
[html]
<tr>
<td width = "50" ><select name="category" >
<option value="1">appet izer </option>
<option value="2">meat and fish</option>
<option value="3">soup </option>
<option value="4">salad </option>
<option value="5">veget arian </option>
<option value="6">desse rt </option>
<option value="7">cold drinks </option>
<option value="8">hot drinks </option>
</select></td>
</tr>
<!--row 3-->
<tr>
<td width = "80" align = "right"> Item Name </td>
<td width = "50"><selec t name="items">
<option value="1">wings </option>
</select></td>
</tr>
[/html]
Comment