I look back at one of the first things I posted on The Daily WTF (tblState) and get a kick out of how naïve I used to be. Back then, most of the worst code I'd come cross would barley make an honorable mention. Back then, I would never have fathomed that code like Scott Neumann's submission even existed. Back then, I didn't fear that I will inevitably have to maintain code like this. Yeah, those were good times back then ...

<%
If session("State") = "AL" Then 
  SelAL = "Selected"
End If
If session("State") = "AK" Then 
  SelAK = "Selected"
End If

If session("State") = "AZ" Then 
  SelAZ = "Selected"
End If
If session("State") = "AR" Then 
  SelAR = "Selected"
End If

If session("State") = "CA" Then 
  SelCA = "Selected"
End If
If session("State") = "CT" Then 
  SelCT = "Selected"
End If
If session("State") = "CO" Then 
  SelCO = "Selected"
End If
If session("State") = "DC" Then 
  SelDC = "Selected"
End If
If session("State") = "DE" Then 
  SelDE = "Selected"
End If
If session("State") = "FL" Then 
  SelFL = "Selected"
End If
If session("State") = "GA" Then 
  SelGA = "Selected"
End If
If session("State") = "HI" Then 
  SelHI = "Selected"
End If

If session("State") = "ID" Then 
  SelID = "Selected"
End If
If session("State") = "IL" Then 
  SelIL = "Selected"
End If
If session("State") = "IN" Then 
  SelIN = "Selected"
End If
If session("State") = "IA" Then 
  SelIA = "Selected"
End If
If session("State") = "KS" Then 
  SelKS = "Selected"
End If
If session("State") = "KY" Then 
  SelKY = "Selected"
End If
If session("State") = "LA" Then 
  SelLA = "Selected"
End If
If session("State") = "ME" Then 
  SelME = "Selected"
End If
If session("State") = "MA" Then 
  SelMA = "Selected"
End If
If session("State") = "MD" Then 
  SelMD = "Selected"
End If
If session("State") = "MI" Then 
  SelMI = "Selected"
End If

If session("State") = "MN" Then 
  SelMN = "Selected"
End If
If session("State") = "MS" Then 
  SelMS = "Selected"
End If
If session("State") = "MO" Then 
  SelMO = "Selected"
End If

If session("State") = "MT" Then 
  SelMT = "Selected"
End If
If session("State") = "NE" Then 
  SelNE = "Selected"
End If

If session("State") = "NV" Then 
  SelNV = "Selected"
End If

If session("State") = "NH" Then 
  SelNH = "Selected"
End If

If session("State") = "NJ" Then 
  SelNJ = "Selected"
End If

If session("State") = "NM" Then 
  SelNM = "Selected"
End If

If session("State") = "NY" Then 
  SelNY = "Selected"
End If
If session("State") = "NC" Then 
  SelNC = "Selected"
End If
If session("State") = "ND" Then 
  SelND = "Selected"
End If
If session("State") = "OH" Then 
  SelOH = "Selected"
End If
If session("State") = "OK" Then 
  SelOK = "Selected"
End If
If session("State") = "OR" Then 
  SelOR = "Selected"
End If
If session("State") = "PA" Then 
  SelPA = "Selected"
End If
If session("State") = "RI" Then 
  SelRI = "Selected"
End If
If session("State") = "SC" Then 
  SelSC = "Selected"
End If
If session("State") = "SD" Then 
  SelSD = "Selected"
End If
If session("State") = "TN" Then 
  SelTN = "Selected"
End If
If session("State") = "TX" Then 
  SelTX = "Selected"
End If
If session("State") = "UT" Then 
  SelUT = "Selected"
End If
If session("State") = "VT" Then 
  SelVT = "Selected"
End If
If session("State") = "VA" Then 
  SelVA = "Selected"
End If
If session("State") = "WY" Then 
  SelWY = "Selected"
End If
If session("State") = "WI" Then 
  SelWI = "Selected"
End If
If session("State") = "WV" Then 
  SelWV = "Selected"
End If
If session("State") = "WA" Then 
  SelWA = "Selected"
End If
%>

<select class="f" name="State">
  <option value>Stateoption>
  <option value="AL" <%=SelAL%>>>ALoption>
  <option value="AK" <%=SelAK%>>>AKoption>
  <option value="AZ" <%=SelAZ%>>>AZoption>
  <option value="AR" <%=SelAR%>>>ARoption>
  <option value="CA" <%=SelCA%>>>CAoption>
  <option value="CT" <%=SelCT%>>>CToption>
  <option value="CO" <%=SelCO%>>>COoption>
  <option value="DC" <%=SelDC%>>>D.C.option>
  <option value="DE" <%=SelDE%>>>DEoption>
  <option value="FL" <%=SelFL%>>>FLoption>
  <option value="GA" <%=SelGA%>>>GAoption>
  <option value="HI" <%=SelHI%>>>HIoption>
  <option value="ID" <%=SelID%>>>IDoption>
  <option value="IL" <%=SelIL%>>>ILoption>
  <option value="IN" <%=SelIN%>>>INoption>
  <option value="IA" <%=SelIA%>>>IAoption>
  <option value="KS" <%=SelKS%>>>KSoption>
  <option value="KY" <%=SelKY%>>>KYoption>
  <option value="LA" <%=SelLA%>>>LAoption>
  <option value="ME" <%=SelME%>>>MEoption>
  <option value="MA" <%=SelMA%>>>MAoption>
  <option value="MD" <%=SelMD%>>>MDoption>
  <option value="MI" <%=SelMI%>>>MIoption>
  <option value="MN" <%=SelMN%>>>MNoption>
  <option value="MS" <%=SelMS%>>>MSoption>
  <option value="MO" <%=SelMO%>>>MOoption>
  <option value="MT" <%=SelMT%>>>MToption>
  <option value="NE" <%=SelNE%>>>NEoption>
  <option value="NV" <%=SelNV%>>>NVoption>
  <option value="NH" <%=SelNH%>>>NHoption>
  <option value="NJ" <%=SelNJ%>>>NJoption>
  <option value="NM" <%=SelNM%>>>NMoption>
  <option value="NY" <%=SelNY%>>>NYoption>
  <option value="NC" <%=SelNC%>>>NCoption>
  <option value="ND" <%=SelND%>>>NDoption>
  <option value="OH" <%=SelOH%>>>OHoption>
  <option value="OK" <%=SelOK%>>>OKoption>
  <option value="OR" <%=SelOR%>>>ORoption>
  <option value="PA" <%=SelPA%>>>PAoption>
  <option value="RI" <%=SelRI%>>>RIoption>
  <option value="SC" <%=SelSC%>>>SCoption>
  <option value="SD" <%=SelSD%>>>SDoption>
  <option value="TN" <%=SelTN%>>>TNoption>
  <option value="TX" <%=SelTX%>>>TXoption>
  <option value="UT" <%=SelUT%>>>UToption>
  <option value="VT" <%=SelVT%>>>VToption>
  <option value="VA" <%=SelVA%>>>VAoption>
  <option value="WA" <%=SelWA%>>>WAoption>
  <option value="WY" <%=SelWY%>>>WYoption>
  <option value="WI" <%=SelWI%>>>WIoption>
  <option value="WV" <%=SelWV%>>>WVoption>
select>
[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!