Forums

ASP

This topic is locked

Dynamic droplist

Posted 21 Feb 2002 10:52:04
1
has voted
21 Feb 2002 10:52:04 Bec C posted:
I have a droplist that is populated dynamically from a database.

The page is a customer record editor. Sales people are assigned to a global sales list which is used on this page for selection.
I would like to automatically select the correct sales person who is linked to that person.

I can do it with a standard drop list by doing the following:

<select name="title">
<option value="Mr">Mr</option>
<option value="Mrs" <% if rsUser.Fields.Item("title".Value = "Mrs" then response.write("Selected" %>>Mrs</option>
<option value="Miss" <% if rsUser.Fields.Item("title".Value = "Miss" then response.write("Selected" %>>Miss</option>
<option value="Ms" <% if rsUser.Fields.Item("title".Value = "Ms" then response.write("Selected" %>>Ms</option>
</select>

But dynamically I cannot do the same as the values are never guaranteed to be the same - new sales people/deleting sales people etc. Any ideas would be great.

Thanks

Reply to this topic