根据数据库的值,来动态分配表单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>