Jump to content

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


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>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.