Need HTML/ASP <Select> tag help please!?

  • Thread starter Thread starter stevo
  • Start date Start date
S

stevo

Guest
I'm trying to list the options in the select box in alphabetical order. Do I have to run a query in the database, and then get my data from the query?

I'm looking for the quickest way possible, as I'm going to have to do it for a final tomorrow.

Thanks for any suggestions
 
Personally, I would simply add

ORDER BY optionName ASCENDING

to the query in the database - it would be much easier and quicker than doing the sort in the front end.
 
create a query from the beginning of your ASP page.
like this code below


rs.open "Select * from students order by studID asc", AdoConn, 1, 3
rs.requery



then, put these code where it is needed

<% do while not rs.eof %>
<option value="<%=Rs("studID")%>"><%=Rs("studID")%></option>

<%
rs.movenext
loop
%>
 
Back
Top