gpt4 book ai didi

asp-classic - 逗号分隔的字符串变成经典 asp 中的下拉列表

转载 作者:行者123 更新时间:2023-12-02 05:29:25 26 4
gpt4 key购买 nike

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

我在经典的 asp 页面中工作。

请帮帮我

最佳答案

试一试:

<%
' 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>"
%>

关于asp-classic - 逗号分隔的字符串变成经典 asp 中的下拉列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12617496/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com