<select name="expMonth"> <option value="01"<?if($_POST['expMonth']=="01"){?> selected<?}?>>January</option> <option value="02"<?if($_POST['expMonth']=="02"){?> selected<?}?>>February</option> <option value="03"<?if($_POST['expMonth']=="03"){?> selected<?}?>>March</option> </select>
I don't understand
1) why each line has "selected" by itself and not the expected
selected="selected"
and 2) why each line has this code snippet at all.
The objective is to get rid of all the drop-downs and use a function instead of replicating the gory details over and over (there are 12 places this is used) but until I understand this, I can't write the correct function.
Any ideas?
This post has been edited by no2pencil: 19 October 2012 - 08:15 PM
Reason for edit:: Added Code Tags