Forums
This topic is locked
Dropdown list in update form
Posted 02 Jun 2010 10:44:31
1
has voted
02 Jun 2010 10:44:31 stephan ludovic posted:
Hi,I ve got a update form with a dropdown list ( values comming from database table "status".
In this form, the user could change his status (from the dropdown list)
Example : Mr X Single (status)
changing to maried (status) from the dropdown list
My dropdown list displays as well the different status from database table status but i want to display the actual status before changing in update form...
How can i do this?
Perharps, it's not clear?:-)
Edited by - stephan ludovic on 02 Jun 2010 10:45:11
Replies
Replied 03 Jun 2010 12:39:08
03 Jun 2010 12:39:08 Seb Adlington replied:
Hi Stephan,
Not sure if I read your post right but I think you want the drop down list to show the actual value from the database??
Try this - where User is your recordset and the language here is Javascript
Not sure if I read your post right but I think you want the drop down list to show the actual value from the database??
Try this - where User is your recordset and the language here is Javascript
<select name="Status" id="Status"> <option value="Married" <%if(User.Fields.Item("Status").Value == "Married"){%>SELECTED<%}%>>Married<option> <option value="Single" <%if(User.Fields.Item("Status").Value == "Single"){%>SELECTED<%}%>>Single<option> </select>