L
Lukelrc
Hi,
I have a dynamically created listbox. I'm trying to get one of the
options selected according to a passed value. This is what i have:
<select name="txtTheme" id="txtTheme">
<option>Select Theme</option>
<%
Dim PassedTheme
Dim PickThis
PassedTheme = Request("txtTheme") %>
<% While (NOT RsThemes.EOF)%>
<% If Not rsChosenEvent.EOF Or Not rsChosenEvent.BOF Then %><% If
PassedTheme = (RsChosenEvent.Fields.Item("Theme").Value) Then Pickthis
= " SELECTED " %><% End IF %>
<option <%= PickThis %>
value="<%=(RsThemes.Fields.Item("ThemeID").Value)%>"><%=(RsThemes.Fields.Item("ThemeName").Value)%></option>
<%
RsThemes.MoveNext()
Wend
If (RsThemes.CursorType > 0) Then
RsThemes.MoveFirst
Else
RsThemes.Requery
End If
%>
but for some reason PickThis is never writes " SELECTED " in the HTML
when it sould (i.e when Request("txtTheme") =
(RsChosenEvent.Fields.Item("Theme").Value)). I can't see why this
shouldn't work. Does anyone know how i can do this/workaround this?
I have a dynamically created listbox. I'm trying to get one of the
options selected according to a passed value. This is what i have:
<select name="txtTheme" id="txtTheme">
<option>Select Theme</option>
<%
Dim PassedTheme
Dim PickThis
PassedTheme = Request("txtTheme") %>
<% While (NOT RsThemes.EOF)%>
<% If Not rsChosenEvent.EOF Or Not rsChosenEvent.BOF Then %><% If
PassedTheme = (RsChosenEvent.Fields.Item("Theme").Value) Then Pickthis
= " SELECTED " %><% End IF %>
<option <%= PickThis %>
value="<%=(RsThemes.Fields.Item("ThemeID").Value)%>"><%=(RsThemes.Fields.Item("ThemeName").Value)%></option>
<%
RsThemes.MoveNext()
Wend
If (RsThemes.CursorType > 0) Then
RsThemes.MoveFirst
Else
RsThemes.Requery
End If
%>
but for some reason PickThis is never writes " SELECTED " in the HTML
when it sould (i.e when Request("txtTheme") =
(RsChosenEvent.Fields.Item("Theme").Value)). I can't see why this
shouldn't work. Does anyone know how i can do this/workaround this?