Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SORTING A DROPDOWN MENU ??

Status
Not open for further replies.

kingjjx

Programmer
Joined
Sep 18, 2001
Messages
181
Location
US
How do you order a list in a drop down box ???
I have this code: (How do I sort/make the dropdown list be in ascending/descending order? .. like all the models that start with "A" on top of the menu ?)

Model:
<SELECT NAME=&quot;SearchModel&quot;>
<OPTION VALUE=&quot;all&quot;>ALL
<cfoutput query=&quot;Searchdyno&quot;>
<OPTION VALUE=&quot;#Model#&quot;>#Model#
</cfoutput>
</select>

THANKS
-JON
 
in your query Searchdyno you sould have something that looks like this

select whatever
from tablename
where clause (if appropriate)


after the where clause add a line that says Order By Model ASC

this will then sort the data before it gets to the dropdown list and then you just output it in the same way that you have above !

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top