Jump to content

Trouble with an option menu default being set to a field or variable value


mm00re

Recommended Posts

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 :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.