Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Help with dropdown menu

New Here ,
Mar 14, 2007 Mar 14, 2007
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>
TOPICS
Server side applications
360
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 14, 2007 Mar 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>
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 17, 2007 Apr 17, 2007
LATEST
try webassist.com dynamic dropdown
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines