When trying to search for this specific thing I’d like to do, I end up only finding how to create the drop down menu from a database, which I have already done. I’m building a list to track completed tasks of a predefined number of people that are in their own table. The record will save the name of the person that completed the task What I’m looking for is as follows:
Employee Table:
— (nothing selected)
Sara Johnson
John Doe
Mark O’Brien
Task Table:
Clean counters
Unlock doors
Turn on lights
So right now there is the task, then a drop down that puts the employees names in it. What I want is, if insert a record, then come back to the page, to automatically see if the task has someone that has completed it and automatically select it, but leaves the possibility to be changed from the same drop down.
Right now, it will delete the current record with whatever the user puts in, so if they didn’t know if someone turned on the lights, it will erase it and replace it with “—.” This makes the user have to look up the record, see if anyone put anything in, then, basically recreate the record as it was, then add whatever changes they needed.
I hope that makes any kind of sense.
I have some trouble understanding your problem but what I assume you are looking for is a way to set the default selection of a drop down field. In HTML you can do that by adding the attribute
selected="selected"to the<option>tag. It would look like this:If that is not what you meant, please explain further. 🙂