programming-examples/asp/Others/ASP-CSS Drop-down.asp

41 lines
1.2 KiB
Plaintext
Raw Permalink Normal View History

2019-11-18 14:25:58 +01:00
<%'To check the browser capabilities this goes above everything
Function checkbrowser
Set check = Server.CreateObject("MSWC.BrowserType")
If check.browser="IE" And check.version >= "4.0" Then
checkbrowser = "DropStyle"
Else
checkbrowser = ""
End If
End Function
'this goes in the head. very basic CSS
%>
<style>
<!--
.DropStyle {font-family: verdana;
font-size: 8pt;
font-weight: normal;
color: black;
width:144;
}
-->
</style>
<%'This drop-down assumes that you have the conn 2 the database Set up and you've build a RS.
%>
<TABLE>
<TR>
<TD colspan="1" bgcolor=#66C299 align="center">
<FONT face="verdana" size=1>
<Select name="theme" Class="<%=CheckBrowser%>">
<Option value="">Select a theme</Option>
<Option value="">-----------------</Option>
<%if Not rs.eof Then
Do until rs.eof
Response.Write("<OPTION value='" & Trim(rs("name")) & "'>" & Trim(rs("name")) & "</OPTION>")
rs.Movenext
Loop
End if%>
</FONT></Select>
</TD>
</TR>
</TABLE>