
根據數據庫的值,來動態分配表單selected="selected"的部分代碼
<select name="bigid" size="1" id="text02">
<option>----------請選擇當前預訂所屬的商家-----------</option>
<%
sql = "select * from company order by F_Id asc"
Set rst = Server.CreateObject("ADODB.RecordSet")
rst.Open sql,conn,1,1
do while not rst.eof
%>
<option value='<%=rst("f_id")%>' <% if rst("f_id")=int(rrs("bigid")) then %>selected<% end if %>><%=rst("f_Company")%></option>
<%
rst.movenext
loop
rst.close
%>
</select>
根據數據庫的值,來靜分配selected="selected"的部分代碼
<option <%if color="#000000" then response.write "selected"%> value="#000000" style="background-color:#000000"></option>
您發布的評論即表示同意遵守以下條款:
一、不得利用本站危害國家安全、泄露國家秘密,不得侵犯國家、社會、集體和公民的合法權益;
二、不得發布國家法律、法規明令禁止的內容;互相尊重,對自己在本站的言論和行為負責;
三、本站對您所發布內容擁有處置權。