1
VBSドロップダウンリストには、他のすべてのリストに「すべて」というオプションが表示されます。VBS - ドロップダウンリストは、1行おきにデフォルトオプションを生成します。
私はこの問題が私のオプション値のどこかにあることを知っていますが、これを修正する方法がわかりません。
<%
Dim DataConn
Dim customersel
Dim SQL
Set DataConn = Server.CreateObject("ADODB.Connection")
Set customersel = Server.CreateObject("ADODB.Recordset")
%>
<%
DataConn.Open "DSN=***;UID=***;PWD=***"
SQL = "select customername FROM log.dbo.customer order by customerName"
customersel.Open SQL, DataConn
%>
<select Name="customersel" id="customersel">
<%While Not customersel.EOF%>
<% if Request.Form("customersel") = "0" then %>
<option value="0" selected>All
<% else %>
<option value="0">All
<% end if %>
<option value="<%= customersel("customername") %>"><%= customersel("customername") %></option>
<%
customersel.MoveNext
Wend
customersel.Close
Set customersel = Nothing
DataConn.Close
Set DataConn = Nothing
%>
</select>
トルドーフェルナンデス・ソリューション:
<select Name="customersel" id="customersel">
<% if Request.Form("customersel") = "0" then %>
<option value="0" selected>All</option>
<% else %>
<option value="0">All</option>
<% end if %>
<%While Not customersel.EOF%>
<option value="<%= customersel("customername") %>"><%= customersel("customername") %></option>
は、ifの条件を移動しますループの前(外)(前)。すべてのオプション –
Ughにはも入れないでください。どうもありがとうございました。私はそれがそんなに愚かなものだと思った。あなたの回答を答えにするにはどうすればいいですか? – jwabsolutionprime
確信しています。コメントを投稿するか、回答を追加します。:) –