rags_asr Posted September 25, 2011 Share Posted September 25, 2011 hii,everyone... i am new to the forum ..so forgive me if i make some errors in describing my problem i want to create a drop down menu...the values of which i want to retrieve from a table i have created in my database... i have been able to acheive this...but i want a second drop down menu...in which i want the values to get filtered according to the selection of the first drop down menu... i hav a table with the name test...which i am connecting to the first drop down menu i hav created another table with the name testtype...for second menu.. the id of first table is the testid of second... plzz help me with creating the second menu... my code is <?php $sql_result = "select test_series FROM test"; $result = mysql_query($sql_result); ?> <td>Select Test Series </td> <td> <select name="testseries" id="testseries" )"> <option>Select</option> <?php if(mysql_num_rows($result)) { while($row = mysql_fetch_assoc($result)) { $test = $row['test_series'];?> <option><?php echo $test ?></option> <?php } } else {?> <option>No Names Present</option>"; <?php } ?> </select> </td> </tr> <tr> <?php $testseries = $_POST['testseries']; $query = "select id from test where test_series = '$testseries'"; $resultt = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($resultt); $id = $row['id']; $sql_result = "select test_name FROM testtype where testid = $id"; $result = mysql_query($sql_result); ?> <td>Select Test Name </td> <td> <select name="testtype"> <option>Select</option> <?php if(mysql_num_rows($result)) { while($row = mysql_fetch_assoc($result)) { $test2 = $row['test_name'];?> <option><?php echo $test2 ?></option> <?php } } else {?> <option>No Names Present</option>"; <?php } ?> </select> </td> </tr> IN THIS CODE I AM GETTIN AN ERROR Undefined index: testseries in ..addques.php on line 155 WHICH IS THIS ONE $testseries = $_POST['testseries']; Quote Link to comment https://forums.phpfreaks.com/topic/247835-multiple-dynamic-drop-down-menu/ Share on other sites More sharing options...
voip03 Posted September 25, 2011 Share Posted September 25, 2011 this link will help you. http://css-tricks.com/2282-simple-jquery-dropdowns/ Quote Link to comment https://forums.phpfreaks.com/topic/247835-multiple-dynamic-drop-down-menu/#findComment-1272612 Share on other sites More sharing options...
voip03 Posted September 25, 2011 Share Posted September 25, 2011 Need ajax Quote Link to comment https://forums.phpfreaks.com/topic/247835-multiple-dynamic-drop-down-menu/#findComment-1272625 Share on other sites More sharing options...
rags_asr Posted September 25, 2011 Author Share Posted September 25, 2011 i dnt have any knowledge of ajax...can u help me with it? Quote Link to comment https://forums.phpfreaks.com/topic/247835-multiple-dynamic-drop-down-menu/#findComment-1272638 Share on other sites More sharing options...
voip03 Posted September 29, 2011 Share Posted September 29, 2011 http://www.tizag.com/ajaxTutorial/ Quote Link to comment https://forums.phpfreaks.com/topic/247835-multiple-dynamic-drop-down-menu/#findComment-1273853 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.