This topic is locked

transform from selection box to dropdown menu

11/3/2003 5:22:57 AM
ASPRunnerPro General questions
S
Sushy99 author

Hi all, i would like to view a dropdown menu instead of the selection box created by ASPrunner.
this is the code:

Function BuildSelectControl(strName, strValue)
BuildSelectControl=""

Set rsTemp = server.CreateObject ("ADODB.Recordset")

strSQL =""

strSize = 1


 if "Contact_Created_By" = strName then  strSize = 5 : arr = Array("Rona", "Marcucci", "Pilo", "Muzzolon", "Grosoli") end if



 if "Contact_Modified_By" = strName then  strSize = 5 : arr = Array("Rona", "Marcucci", "Pilo", "Muzzolon", "Grosoli") end if


if strSQL <> "" then
     rsTemp.open strSQL, dbConnection

     

     if rsTemp.EOF then exit function

     BuildSelectControl = BuildSelectControl & "<select size = " & strSize & " name=""" & strName & """>"

     BuildSelectControl = BuildSelectControl & "<option value="""">Please select</option>"
     while not rsTemp.Eof

       if rsTemp(0)=strValue then

       BuildSelectControl = BuildSelectControl & "<option value=""" & rsTemp(0) & """ selected>" & rsTemp(1) & "</option>"

       else

       BuildSelectControl = BuildSelectControl & "<option value=""" & rsTemp(0) & """>" & rsTemp(1) & "</option>"

       end if

       rsTemp.MoveNext

     wend
     BuildSelectControl = BuildSelectControl & "</select>"
     rsTemp.Close

     set rsTemp = Nothing

else


     BuildSelectControl = BuildSelectControl & "<select size = " & strSize & " name=""" & strName & """>"

     if CInt(strSize)<2 then _

       BuildSelectControl = BuildSelectControl & "<option value="""">Please select</option>"
 for ind=LBound(arr) to UBound(arr)

 if arr(ind)=strValue then

       BuildSelectControl = BuildSelectControl & "<option value=""" & arr(ind) & """ selected>" & arr(ind) & "</option>"

 else

       BuildSelectControl = BuildSelectControl & "<option value=""" & arr(ind) & """>" & arr(ind) & "</option>"

 end if

 next

     BuildSelectControl = BuildSelectControl & "</select>"
end if
End Function


what i have to change to do it?
thanks all

Sergey Kornilov admin 11/4/2003

Hi,
just set strSize to 1 instead of 5.

if "Contact_Created_By" = strName then strSize = 1 : arr = Array("Rona", "Marcucci", "Pilo", "Muzzolon", "Grosoli") end if


The better way to achive the same goal - change select size from 5 to 1 in ASPRunner's dialog box.
Best regards,

Sergey Kornilov

S
Sushy99 author 11/6/2003

thank you Sergey!
nick