getting value from the DB into the drop down list
new_learner | Posted 0:05am 13. February 2010 Server Time |
Hi, I am trying to retrieve the value from the DB and display the same in the drop down list of the form.
What i am trying to do is:
I have field by name called 'Status', while adding the new record, the user has the option to select any 1 from the 5 in the drop down list (list is of : Pending, Completed, In Progress, On Hold, Cancelled).
I am able to update the record however when i want to modify the record, i want to retrieve the value(the value should be listed on the top of the list, 1st position) from DB in the drop down list along with other 4 options, so that the user can select anyone from the list again and update the record.
That is if the user had selected 'In Progress' the 1st time, and later he wants to modify the record, he should be view the last 'Status' in the 1st position of the drop down list and then select 'Completed' and save the record.
I hope i am clear...and its not confusing :)
code:
<select name="AStatus" STYLE="width: 155px" value="<%=recordset("AStatus")%>">
<option value="Pending">Pending</option>
<option value="InProgress">InProgress</option>
<option value="Completed">Completed</option>
<option value="OnHold">On Hold</option>
<option value="Cancelled">Cancelled</option>
</select>
The above code is incorrect...not able to figure out how to use the recordset, so that the value is displayed in the 1st position. |