andrew_ww Posted January 24, 2008 Share Posted January 24, 2008 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> Quote Link to comment https://forums.phpfreaks.com/topic/87576-creating-listmenu-system-where-2-menu-is-based-upon-choice-made-in-first/ Share on other sites More sharing options...
revraz Posted January 24, 2008 Share Posted January 24, 2008 If you want it to change as you change the pulldown and without using a submit button, you need to use javascript. Quote Link to comment https://forums.phpfreaks.com/topic/87576-creating-listmenu-system-where-2-menu-is-based-upon-choice-made-in-first/#findComment-447925 Share on other sites More sharing options...
andrew_ww Posted January 24, 2008 Author Share Posted January 24, 2008 do you have an example as to how this could be done ? Quote Link to comment https://forums.phpfreaks.com/topic/87576-creating-listmenu-system-where-2-menu-is-based-upon-choice-made-in-first/#findComment-447940 Share on other sites More sharing options...
revraz Posted January 24, 2008 Share Posted January 24, 2008 I'm sure they do in the Javascript forum. Quote Link to comment https://forums.phpfreaks.com/topic/87576-creating-listmenu-system-where-2-menu-is-based-upon-choice-made-in-first/#findComment-447942 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.