Skip to main content
Participant
March 14, 2007
Question

Help with dropdown menu

  • March 14, 2007
  • 2 replies
  • 365 views
This is the code for the select menu. It all work okay. The problem is that I need to determine the selection value later in an if statement so I can change code based on the selection. No matter what sytax I use to reference the selection box, I get an error: Expected Then. Please someone help!!

<select name="id<% = rs("ProductId")%>selectcolor" id="selectcolor" onChange="colorchoice">
<%
While (NOT rscolors.EOF)
%>
<% if Left(Request.Querystring("maingroup"), 1)= "A" then%>
<option value="<%=(rscolors.Fields.Item("ColorSuffix").Value)%>" selected><%=(rscolors.Fields.Item("Color").Value)%></option>
<%elseIF rscolors("ColorSuffix") < 49 Then%>
<option value="<%=(rscolors.Fields.Item("ColorSuffix").Value)%>"><%=(rscolors.Fields.Item("Color").Value)%></option>
<%else%>
<%end if %>
<% rscolors.MoveNext()%>

<%Wend
</select>
This topic is closed to new replies. Start a new post to keep the conversation going.

2 replies

Known Participant
April 17, 2007
try webassist.com dynamic dropdown
Inspiring
March 14, 2007
With using straight code you will not be able to determine the selected
value of a dropdown until the form is processed. However you may be able to
get a client side javascript that will grab the values as the dropdown
changes.

--
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver

Valleybiz Internet Design
www.valleybiz.net

"Reannon" <webforumsuser@macromedia.com> wrote in message
news:et9k0d$cfg$1@forums.macromedia.com...
> This is the code for the select menu. It all work okay. The problem is
> that I
> need to determine the selection value later in an if statement so I can
> change
> code based on the selection. No matter what sytax I use to reference the
> selection box, I get an error: Expected Then. Please someone help!!
>
> <select name="id<% = rs("ProductId")%>selectcolor" id="selectcolor"
> onChange="colorchoice">
> <%
> While (NOT rscolors.EOF)
> %>
> <% if Left(Request.Querystring("maingroup"), 1)= "A" then%>
> <option value="<%=(rscolors.Fields.Item("ColorSuffix").Value)%>"
> selected><%=(rscolors.Fields.Item("Color").Value)%></option>
> <%elseIF rscolors("ColorSuffix") < 49 Then%>
> <option
> value="<%=(rscolors.Fields.Item("ColorSuffix").Value)%>"><%=(rscolors.Fields.Ite
> m("Color").Value)%></option>
> <%else%>
> <%end if %>
> <% rscolors.MoveNext()%>
>
> <%Wend
> </select>
>