怎样使用数组来显示下拉菜单?

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

怎样使用数组来显示下拉菜单?

  2021-03-17 我要评论
想了解怎样使用数组来显示下拉菜单?的相关内容吗,在本文为您仔细讲解的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点:怎样何使使用用数数组组来来显显示示下下拉拉菜菜单单??,下面大家一起来学习吧。

Sub DoDropDown(Arr(), strSelName, onchange, strSelected, strexclude)
Dim i
      if strSelected <> "" then
            swap arr, strSelected
      end if
      response.write "<select NAME='" & strSelName & "' SIZE=1 ONCHANGE='" & onchange & "'>"
      For i = 0 To UBound(Arr)
            If arr(i) <> "" And IsNull(Arr(i)) = FALSE and arr(i) <> strexclude Then
                  response.write "<OPTION VALUE=""" & Arr(i) & """>" & Arr(i) & "</OPTION>"
            End If
      Next
      response.write "</select>"
End Sub

Sub Swap(Arr(), strSelected)
'
交换数组中的元素
Dim StoreString, i
      For i = 0 To UBound(Arr)
            If Arr(i) = strSelected Then
                  StoreString = Arr(i)
                  Arr(i) = Arr(0)
                  Arr(0) = StoreString
            End If
      Next
End Sub<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

 

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们