Jump to content

Creating List/Menu system where 2 menu is based upon choice made in first


andrew_ww

Recommended Posts

Hello,

 

I would like to set up a system where the choices displayed within the second list/menu are chosen based upon the choice made in the first list/menu.

 

I under stand that I'm going to have to filter the SQL to take einto account the changes, however I'm having trouoble working out the full solution. 

 

Both the list/menu objects are populated dynamically from to tables (which are linked)

 

Here is the code that I have so far:

 

<td class="bodyText"><div align="left">Type:</div></td>
                              <td class="bodyText">                                  <select name="jmp_type" class="formTextSmall" id="jmp_type">
                                    <option value="value">....</option>
                                    <?php
do {  
?>
                                    <option value="<?php echo $row_rs_type['type']?>"><?php echo $row_rs_type['type']?></option>
                                    <?php
} while ($row_rs_type = mysql_fetch_assoc($rs_type));
  $rows = mysql_num_rows($rs_type);
  if($rows > 0) {
      mysql_data_seek($rs_type, 0);
  $row_rs_type = mysql_fetch_assoc($rs_type);
  }
?>
                                  </select>           </td>
                              <td> </td>
                              <td class="bodyText">Required:</td>
                              <td><select name="jmp_required" class="formTextSmall" id="jmp_required">
                                <option>....</option>
                                <option value="Yes">Yes</option>
                                <option value="No">No</option>
                              </select></td>
                            </tr>
                            <tr>
                              <td class="bodyText"><div align="left">Current Owner:</div></td>
                              <td class="bodyText"><div align="left"><select name="jmp_owner" class="formTextSmall" id="jmp_owner">
                                    <option value="value">....</option>
                                    <?php
do {  
?>
                                    <option value="<?php echo $row_rs_owner['name']?>"><?php echo $row_rs_owner['name']?></option>
                                    <?php
} while ($row_rs_owner = mysql_fetch_assoc($rs_owner));
  $rows = mysql_num_rows($rs_owner);
  if($rows > 0) {
      mysql_data_seek($rs_owner, 0);
  $row_rs_owner = mysql_fetch_assoc($rs_owner);
  }
?>
                                  </select></div></td>
                              <td> </td>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.