This is a forum where members new and old can come to ask questions and get info and opinions. It is not a place to advertise your business or have other forms of advertising, whether it be in your posts or signature.

All links in the forum will not be indexed by Search Engines and any unapproved forms of advertising or spam will be dealt with accordingly, deleted, and that member's account banned.

Forums

Overview » ASP » Dropdown list in update form
Reply

Dropdown list in update form

stephan ludovic
Member



Since: 03 May 2001
Posts: 32
Posted 02 Jun 2010 10:44:31

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

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
Seb Adlington
Freaking Member



Since: 09 Aug 2001
Posts: 104
Replied 03 Jun 2010 12:39:08
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


<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>

Reply to this topic

Message
Reply
Follow us on Facebook Follow us on twitter Subscribe to the RSS feed
Activate your free membership today | Login | Currency