01hanstu Posted April 17, 2009 Share Posted April 17, 2009 Hi, i have a List/Menu object on my php form. What is does at the minute is the user selects the room that they want to view, then they have to clock go. I need this to happen automatically, can this be done? My Current code <form name="roomform" method="post" action="bookingindex.php?week=<? print $mondaythisinstance ?>"> <select name="selectroom" class="formnames"> <option value=" <?PHP print $room ?>" selected>Selected: <?PHP print $room ?></option> <option value="">- - - - - - - - - - -</option> <? while ($loop < $getroomcount) { print"<option value=\"".mysql_result($getroomresults,$loop,"roomname")."\">".mysql_result($getroomresults,$loop,"roomname")."</option>"; $loop ++; } ?> </select> <input name="Submit" type="submit" class="formnames" value="Go"> </div> </form> Then once go is clicked it shows the timetable for the room Hope you can help Stuart Quote Link to comment https://forums.phpfreaks.com/topic/154475-dropdown-box/ Share on other sites More sharing options...
Adam Posted April 17, 2009 Share Posted April 17, 2009 Do you mean when they select the room, you want the data to display instantly? Or to just submit the form without having to press submit? Solution to the latter is to just add: onchange="document.form_name.submit();" ... to your select element. Adam! Quote Link to comment https://forums.phpfreaks.com/topic/154475-dropdown-box/#findComment-812225 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.