Try doing this:

<select name="fieldname">
    <option value="" selected>-- Select a Company ---
    <cfoutput query="queryname">
        <option value="#recordvalue#"> #recordvalue#
    </cfoutput>
</select>


This is the non-cfselect option. I think it has to do with the query
your using to pull values out of the database. If your query displays
the options with the value "selected" on every one, it's going to go
right to the bottom.


Also, as far as I know, it should just be "selected", not
selected="true".


The only time you really need to use CF form fields is when you want
built in client-side error checks. Since you're puling the values from a
database, they should all be valid, in general.

Hope it helps!
- Adam
  

________________________________

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 23, 2004 4:03 PM
To: CF-Newbie
Subject: cfselect :: default selected item shows up last

I'm using cfselect to create a pull-down list from a query, of all the
company names in a database.

I'd like the default to be an option with a null value, with the label "
--SELECT A COMPANY--".

I did this by sticking this inside my CFSELECT <option value="" selected
="true">--Select a Company--</option>

It works fine, but when you click on the form object and the list opens,
this option is listed last, I'd like it to appear up top, is there a way
to
force this?

Paul Colombo
Multimedia Programmer
webLearning.com
w: 973.227.4455
c:  201.819.9027
f:  973.227.8412
________________________________
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to