Well... the cities that populate the multiple select
are returned by a query that provides each distinct city name.

So the cities are not in the db, and all I have to work with
is the name of the city, itself.

I could pull the selected cities "out of the order" and place
them on top of the list, but I'd rather not do that, because
it might confuse the user.

I want the cities to stay in the same order as the query delivers them,
but with the first selected city on the top.

It would be nice if there were some attribute of the select option, like
<option value="#city#" selected top>#city#</option> so I could have that
option with "top" as an attribute "scroll" (not animate) to that point
in the list as the first selection.

I may have to use some jQuery and assign an id to each option dynamically,
then have jQuery find the first selected option and somehow make the
list "scroll" to that point.

Thoughts?

Rick

> -----Original Message-----
> From: Ian Skinner [mailto:[EMAIL PROTECTED]
> Sent: Monday, July 07, 2008 3:19 PM
> To: CF-Talk
> Subject: Re: Is there a way to do this?
> 
> Rick Faircloth wrote:
> > Thanks for the replies, Charlie and Brian...
> >
> > Actually, I should have been more clear.
> >
> > I've got this code working, which "re-selects" all of the
> > selected citis:
> >
> > <cfoutput query="get_cities">
> >     <cfif (isDefined("form.fieldnames") and isDefined("session.city") and 
> > session.city contains
> > #city#) or session.city is #city#>
> >             <option value="#city#" selected>#city# - #num_cities#</option>
> >     <cfelse>
> >             <option value="#city#">#city# - #num_cities#</option>
> >     </cfif>
> > </cfoutput>
> >
> > What I need now is to get the first selected item to display
> > at the top of the list.
> >
> > Will that require javascript?  jQuery, perhaps?
> >
> > Rick
> You could, but if you are building the select in CF as above, just do
> something to sort the query into the desired order with the selected
> city first.  How this could be done depends on how the data is
> organized, but it is 'doable'.
> 
> 
> 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:308687
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to