I am very new to .asp and I have been tasked with updating a dropdown box in one of our web applications to include a "blank" field at the top of the dropdown box so that if a matching result isn't found, it will default to a blank value instead of the first value in the dropdown box.
The code basically pulls a list of locations from a LOCATION table and populates a dropdown box on a form with the list of locations. It contains logic that checks to see if another location field on the form matches any of the locations in the dropdown box. If it does match, it select "that" location as the default, otherwise, it defaults to the first location. What I would like it to do is default to a blank field if it doesn't match a location on the form. Can anyone please help with this????
set RS = ConnDAT.Execute("select distinct location from location order by location asc") do while not RS.eof location = trim(RS(0)) Response.Write "<option value='" & PrepareStringForSave(location) & "'" if location = tSHIPTO then Response.write " selected" Response.Write ">" & location RS.MoveNext loop RS.close