I have been trying to mark as selected, within a drop down list, a value that is returned from my DB. I have the following code that I would like to retain is possible.:
This produces a drop down list with 30 minute increments that I need to use on several places within my site. So far so good.
What I need it to do is to take a value from the DB and mark that value in the list as selected whilst still displaying the full list of times in the drop down to enable the user to change the value if necessary.
This is easy enough with a static drop down list but I would really like to get this working with the code I have so far. Is this possible?
I kinda got to this stage before with some far messier code using if else statements and could never figure a way of not loading a value for the selected option which is why I thought you guys may come up with the answer.