yandoo Posted February 1, 2008 Share Posted February 1, 2008 Hi all, I is possible to have a list/menu in a form that when the user selects an option from it, the result then determines what options are avaliable in another list/menu (the 2nd list/menus table needs to be matched with whatever the the results of the 1st menu are) on the same form. Is it possible??? Thank You Quote Link to comment Share on other sites More sharing options...
avo Posted February 1, 2008 Share Posted February 1, 2008 Hi Hope this starts you on what you need . <form id="form1" name="form1" method="post" action="<?=$PHP_SELF?>"> <select name="select0"> <option value="1"<? if ($_POST['select0']==1) {echo 'selected="selected"' ;} ?>>1 to 5</option> <option value="2" <? if ($_POST['select0']==2) {echo 'selected="selected"' ;} ?>>6-10</option> </select> - <select name="select1"> <? if ($_POST['select0']==1) { for($i=1;$i<=5;$i++) { echo '<option>'.$i.'</option>' ; } } if ($_POST['select0']==2) { for($i=6;$i<=10;$i++) { echo '<option>'.$i.'</option>' ; } } ?> </select> <br /> <br /> <input type="submit" name="Submit" value="Submit" /> </form> Quote Link to comment Share on other sites More sharing options...
yandoo Posted February 1, 2008 Author Share Posted February 1, 2008 Hi there, Thats brilliant thank you Is there any way to do it with out a submit button? Thanks Quote Link to comment Share on other sites More sharing options...
avo Posted February 1, 2008 Share Posted February 1, 2008 Hi There is but you would need to use javascript to do this. Regards. Quote Link to comment 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.