ASP State Listing
Save yourself some time
As I work on various sites, I notice that I keep reusing certain code again and again. One of the pieces that I use the most is a listing of states. Below, I have put this code out for everyone to use (just change the variable name to your liking).
<select name="State" id="State">
<option value="" <% If strState = "" Then %>selected<% End If %>>Select State</ option >
<option value="AL" <% If strState = "AL" Then %>selected<% End If %>>Alabama</ option >
<option value="AK" <% If strState = "AK" Then %>selected<% End If %>>Alaska</ option >
<option value="AZ" <% If strState = "AZ" Then %>selected<% End If %>>Arizona</ option >
<option value="AR" <% If strState = "AR" Then %>selected<% End If %>>Arkansas</ option >
<option value="CA" <% If strState = "CA" Then %>selected<% End If %>>California</ option >
<option value="CO" <% If strState = "CO" Then %>selected<% End If %>>Colorado</ option >
<option value="CT" <% If strState = "CT" Then %>selected<% End If %>>Connecticut</ option >
<option value="DE" <% If strState = "DE" Then %>selected<% End If %>>Delaware</ option >
<option value="DC" <% If strState = "DC" Then %>selected<% End If %>>District Of Columbia</ option >
<option value="FL" <% If strState = "FL" Then %>selected<% End If %>>Florida</ option >
<option value="GA" <% If strState = "GA" Then %>selected<% End If %>>Georgia</ option >
<option value="HI" <% If strState = "HI" Then %>selected<% End If %>>Hawaii</ option >
<option value="ID" <% If strState = "ID" Then %>selected<% End If %>>Idaho</ option >
<option value="IL" <% If strState = "IL" Then %>selected<% End If %>>Illinois</ option >
<option value="IN" <% If strState = "IN" Then %>selected<% End If %>>Indiana</ option >
<option value="IA" <% If strState = "IA" Then %>selected<% End If %>>Iowa</ option >
<option value="KS" <% If strState = "KS" Then %>selected<% End If %>>Kansas</ option >
<option value="KY" <% If strState = "KY" Then %>selected<% End If %>>Kentucky</ option >
<option value="LA" <% If strState = "LA" Then %>selected<% End If %>>Louisiana</ option >
<option value="ME" <% If strState = "ME" Then %>selected<% End If %>>Maine</ option >
<option value="MD" <% If strState = "MD" Then %>selected<% End If %>>Maryland</ option >
<option value="MA" <% If strState = "MA" Then %>selected<% End If %>>Massachusetts</ option >
<option value="MI" <% If strState = "MI" Then %>selected<% End If %>>Michigan</ option >
<option value="MN" <% If strState = "MN" Then %>selected<% End If %>>Minnesota</ option >
<option value="MS" <% If strState = "MS" Then %>selected<% End If %>>Mississippi</ option >
<option value="MO" <% If strState = "MO" Then %>selected<% End If %>>Missouri</ option >
<option value="MT" <% If strState = "MT" Then %>selected<% End If %>>Montana</ option >
<option value="NE" <% If strState = "NE" Then %>selected<% End If %>>Nebraska</ option >
<option value="NV" <% If strState = "NV" Then %>selected<% End If %>>Nevada</ option >
<option value="NH" <% If strState = "NH" Then %>selected<% End If %>>New Hampshire</ option >
<option value="NJ" <% If strState = "NJ" Then %>selected<% End If %>>New Jersey</ option >
<option value="NM" <% If strState = "NM" Then %>selected<% End If %>>New Mexico</ option >
<option value="NY" <% If strState = "NY" Then %>selected<% End If %>>New York</ option >
<option value="NC" <% If strState = "NC" Then %>selected<% End If %>>North Carolina</ option >
<option value="ND" <% If strState = "ND" Then %>selected<% End If %>>North Dakota</ option >
<option value="OH" <% If strState = "OH" Then %>selected<% End If %>>Ohio</ option >
<option value="OK" <% If strState = "OK" Then %>selected<% End If %>>Oklahoma</ option >
<option value="OR" <% If strState = "OR" Then %>selected<% End If %>>Oregon</ option >
<option value="PA" <% If strState = "PA" Then %>selected<% End If %>>Pennsylvania</ option >
<option value="RI" <% If strState = "RI" Then %>selected<% End If %>>Rhode Island</ option >
<option value="SC" <% If strState = "SC" Then %>selected<% End If %>>South Carolina</ option >
<option value="SD" <% If strState = "SD" Then %>selected<% End If %>>South Dakota</ option >
<option value="TN" <% If strState = "TN" Then %>selected<% End If %>>Tennessee</ option >
<option value="TX" <% If strState = "TX" Then %>selected<% End If %>>Texas</ option >
<option value="UT" <% If strState = "UT" Then %>selected<% End If %>>Utah</ option >
<option value="VT" <% If strState = "VT" Then %>selected<% End If %>>Vermont</ option >
<option value="VA" <% If strState = "VA" Then %>selected<% End If %>>Virginia</ option >
<option value="WA" <% If strState = "WA" Then %>selected<% End If %>>Washington</ option >
<option value="WV" <% If strState = "WV" Then %>selected<% End If %>>West Virginia</ option >
<option value="WI" <% If strState = "WI" Then %>selected<% End If %>>Wisconsin</ option >
<option value="WY" <% If strState = "WY" Then %>selected<% End If %>>Wyoming</ option >
</select>