This topic is locked

Problem with dropdown in edit mode

11/24/2004 4:00:31 AM
ASPRunnerPro General questions
J
joost author

Hi,
We have found a problem with the dropdown in edit mode. It does not always pick up the selected value, or even does not load anything. This is both the case for select from static lists as for database.
For example we had a dropdown with the values 100, 10, 1, 0, 0.1, 0.01
The problem is solved when we add trim around the functions see belkow. Maybe this can be added to the new version?

for ind=LBound(arr) to UBound(arr)

 bYes = false

 if IsNumeric(arr(ind)) then

   if CInt(trim(arr(ind))) = trim(strValue) then bYes = true

 end if
 if trim(arr(ind))=trim(strValue) or bYes then

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

 else

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

 end if

 next
Sergey Kornilov admin 11/28/2004

Joost,
please download latest update here that fixes the issue:

http://www.asprunner.com/files/asprunnerpro31a.exe

J
joost author 12/9/2004

Hi,
Thanks, this has solved it for dropdowns based on a database table. However the static dropdown still has the problem.

     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)

 bYes = false

 if IsNumeric(arr(ind)) then

   if CDbl(arr(ind)) = strValue then bYes = true

 end if

 if arr(ind)=strValue or bYes 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>"


We did trim both the sides of both the if statements and it works fine.
Can you also correct this.
Thanks again,
Joost