mm00re Posted June 23, 2009 Share Posted June 23, 2009 I am trying to setup a way that is easy to keep track of time for classes based on quarter hours. Whenever you select the option menu it shows the correct value at the top of the list but will not select the default item. so my option menu looks like this until clicked: 0 mins (0.00 hrs) 15 mins (0.25 hrs) 30 mins (0.50 hrs) 45 mins (0.75 hrs) Whenever you click the menu it looks like this: 25 0 mins (0.00 hrs) 15 mins (0.25 hrs) 30 mins (0.50 hrs) 45 mins (0.75 hrs) echo 'Class Length: <SELECT NAME="custom10" SIZE="1" ID="mins"> <OPTION VALUE="' . $minutes . '">' . $minutes . '</OPTION> <OPTION SELECTED="SELECTED" VALUE="0" <? if ($minutes=="0"){print "selected=\"selected\"";} ?> 0 mins (0.00 hrs)</OPTION> <OPTION VALUE="25" <? if ($minutes=="25"){print "selected=\"selected\"";} ?> 15 mins (0.25 hrs)</OPTION> <OPTION VALUE="50" <? if ($minutes=="50"){print "selected=\"selected\"";} ?> 30 mins (0.50 hrs)</OPTION> <OPTION VALUE="75" <? if ($minutes=="75"){print "selected=\"selected\"";} ?> 45 mins (0.75 hrs)</OPTION>";</SELECT>'; Any help is appreciated Link to comment https://forums.phpfreaks.com/topic/163424-trouble-with-an-option-menu-default-being-set-to-a-field-or-variable-value/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.