2012-09-27 20 views

回答

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>" 
%> 
+1

對於每個選項,它應該是'value =「...」'而不是'name =「...」。 –

+0

乾杯暗影精靈你是完全正確的 – DevCentral