Thundarfoot Posted January 18, 2008 Share Posted January 18, 2008 This form gets its choices from a table, except for first default choice ALL which is manual. Is there a way to make the form default to a choice from the table, but still have the manual choice of All in the list? Reason I want to do this is that currently when the page loads the default is to show all records this can be a waste of bandwith and time if user doesnt need to see All....here is the code... Any help is very much appreciated. Link to comment https://forums.phpfreaks.com/topic/86685-drop-down-form-order-of-choices/ Share on other sites More sharing options...
Thundarfoot Posted January 18, 2008 Author Share Posted January 18, 2008 <form id="form1" name="form1" method="post" action=""> <label>Class <select name="select"> <option value="">ALL</option> <?php do { ?> <option value="<?php echo $row_Class['Class']?>"><?php echo $row_Class['Class']?></option> <?php } while ($row_Class = mysql_fetch_assoc($Class)); $rows = mysql_num_rows($Class); if($rows > 0) { mysql_data_seek($Class, 0); $row_Class = mysql_fetch_assoc($Class); } ?> </select> </label> <input type="submit" name="submit" value="submit"> </form> Link to comment https://forums.phpfreaks.com/topic/86685-drop-down-form-order-of-choices/#findComment-443017 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.