Problem in dealing with multiple dropdown lists

# Thread: Problem in dealing with multiple dropdown lists

1. Senior Member
Join Date
Dec 1969
Posts
175

## Problem in dealing with multiple dropdown lists

2. Senior Member
Join Date
Dec 1969
Posts
96,118

## Can we get you to start over???

Just for starters, the whole concept of generating your own array from a recordset is scary.<BR><BR>Have you not heard of GETROWS? Which converts the recordset to an array in one statement?<BR><BR>And there&#039;s some other weird spots in your code, as well as unneeded code.<BR><BR>Just to pick one example:<BR><BR>&#060;OPTION Value="NONE"<BR>&#060;% If Go = 1 OR SEL1Chosen = "NONE" Then %&#062;<BR>SELECTED<BR>&#060;% End If %&#062; <BR>&#062;--Choose a RNC ID--&#060;/OPTION&#062; <BR><BR>That&#039;s really pointless. The first &#060;OPTION&#062; will *always* be SELECTED if no other &#060;OPTION&#062; is. This accomplishes the same thing:<BR><BR> &#060;OPTION Value="NONE"&#062;--Choose a RNC ID--&#060;/OPTION&#062; <BR><BR>And then you have the ugly logic to choose the right table:<BR><BR>If SEL2Chosen = 1 Then<BR> SQLstr2 = "SELECT HOPG_Id AS HOP_Id from W_HOPG" & " WHERE RNCCode = 900" & SEL1Chosen<BR>ElseIf SEL2Chosen = 2 Then<BR> SQLstr2 = "SELECT HOPI_Id AS HOP_Id from W_HOPI" & " WHERE RNCCode = 900" & SEL1Chosen<BR>Else <BR> SQLstr2 = "SELECT HOPS_Id AS HOP_Id from W_HOPS" & " WHERE RNCCode = 900" & SEL1Chosen<BR>End If<BR><BR>Ummm...why didn&#039;t you just construct the &#060;OPTION&#062;s as<BR> &#060;OPTION Value="HOPG_id"&#062; HOPG<BR> &#060;OPTION Value="HOPI_id"&#062; HOPI<BR> &#060;OPTION Value="HOPS_id"&#062; HOPS<BR>and then simply do<BR><BR> SQLstr2 = "SELECT " & SEL2Chosen & " AS HOP_Id " _<BR> & " FROM W_HOPS WHERE RNCCode = 900" & SEL1Chosen<BR><BR>with no IFs?<BR><BR><BR>And I&#039;m truly mystified as to why you would do<BR> &#060;OPTION Value="&#060;%=i+1%&#062;"&#062;&#060;%=arr3(i)%&# 062;&#060;/OPTION&#062;<BR>instead of simply<BR> &#060;OPTION Value="&#060;%=arr3(i)%&#062;"&#062;&#060;%=arr3(i )%&#062;&#060;/OPTION&#062;<BR>Or, even more simply<BR> &#060;OPTION&#062;&#060;%=arr3(i)%&#062;&#060;/OPTION&#062;<BR><BR>What value is there in getting the *index* of the chosen option instead of getting the actual value chosen???<BR><BR><BR><BR><BR>

3. Senior Member
Join Date
Dec 1969
Posts
175

## RE: Correct way of getting back the dropdownlist v

Tks for correcting my codes..So can i get back the dropdownlist select values in using the following codes cos i seem to get back null values..<BR><BR>&#060;coding&#062;<BR>SEL1Chosen = Request.Form("SEL1")<BR>SEL2Chosen = Request.Form("SEL2")<BR>&#060;/coding&#062;

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•