Forums
This topic is locked
SELECTED in dynamic select problem
Posted 06 Aug 2002 16:54:07
1
has voted
06 Aug 2002 16:54:07 Peter Elkjaer posted:
Hi, I have a dynamic select menu.It works fine - but the "selected" function does not.
When I choose an option and the page loads, I want the option I chose to be
selected, but the last option is always selected.
<select name="selMainMenu" id="selMainMenu"
onChange="document.location.href='/cms/editor.asp?MainMenuId='+this.options[
this.selectedIndex].value;">
<option value="" <%If (Not
isNull((rsMenuSel.Fields.Item("MainMenuId"

CStr((rsMenuSel.Fields.Item("MainMenuId"

Response.Write("SELECTED"


<%
While (NOT rsMenuSel.EOF)
%>
<option value="<%=(rsMenuSel.Fields.Item("MainMenuId"

isNull((rsMenuSel.Fields.Item("MainMenuId"

(CStr(rsMenuSel.Fields.Item("MainMenuId"

CStr((rsMenuSel.Fields.Item("MainMenuId"

Response.Write("SELECTED"


><%=(rsMenuSel.Fields.Item("MenuTitle"

<%
rsMenuSel.MoveNext()
Wend
If (rsMenuSel.CursorType > 0) Then
rsMenuSel.MoveFirst
Else
rsMenuSel.Requery
End If
%>
</select>