ASP Listbox showing stored value
Posted on 1999-01-06
Using ASP, HTML and Vbscript, I have a listbox that successfully updates a database with the value chosen (code shown below).
strSex = Session("Sex")
<td><select name="Sex" size="1">
This works fine, but how do I get the List Box to display the present choice from the database, in situations where the user is editing the record.
I have already retrived the value and placed it in a variable named strSex but cannot get the List box to recognise the existing value. The problem this is causing is that the user can select a value, update the database, but when they choose to edit the record again, the list box is showing the default value, NOT the database value, which is subsequently written to the database.
Any help would be MUCH appreciated as I am new to ASP.