2

我有一个逗号分隔的字符串,比如 12345,67890,3453,124556,56778,我想在下拉列表中显示这些项目

我正在使用经典的 asp 页面。

请帮助我

4

1 回答 1

5

试试这个:

<%
' put your string into a variable.
Dim myString : myString = "12345,67890,3453,124556,56778"

' split your variable up into a array
Dim splitmystring : splitmystring = split(myString,",")

' create a dropdown box
Response.write  "<select value=""dropdown"">"
Response.write  "<option selected>choose a option</option>"

' Loop through your array
For Each item In splitmystring
    response.write "<option value='"& item &"'>"& item & "</option>"
Next

'close your dropdown box
response.write "</select>"
%>
于 2012-09-27T10:02:21.503 回答