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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forms select box from query 2

Status
Not open for further replies.

vsimmons

Programmer
Jun 15, 2002
9
0
0
US
I have the following code that returns subject numbers from a query and puts them in a forms list that you can choose from. The results appear as follows: 1-5-020 MAR, 1-5-021 JAX, etc. (the numbers in the subject ID are ordering correctly)

When I add the All Subjects option, it puts this at the bottom of the list. Is there a way for me to get it at the top and still maintain the correct number sorting of the subject IDs?

Thanks!

<cfselect name=&quot;p_subjects&quot; query=&quot;qSubjects&quot; display=&quot;subject&quot; value=&quot;subj_seq&quot; required=&quot;yes&quot; multiple=&quot;yes&quot; size=&quot;10&quot; message=&quot;You must choose a subject&quot;>

<option value=&quot;ALL&quot; >All Subjects</option>

</cfselect>
 
Yes, ofcourse ;-)

The only thing you should not do, is using the cfselect tag. What you should do:

<select size=&quot;10&quot; multiple=&quot;yes&quot; name=&quot;p_subjects&quot;>
<OPTION selected value=&quot;ALL&quot;>All Subjects</option>
<cfoutput query=&quot;qSubjects&quot;>
<OPTION value=&quot;#qSubjects.ID#&quot;>#qSubjects.Subject#</option>
</cfoutput>
</select>


It's just as easy as that!


Charl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top