While you're building your select box, you can use :

<cfoutput query="myquery">
        <option value="#myquery.mycolumn#"
        <cfif not comparenocase(myquery.mycolumn,selectedvalue)>
        SELECTED</cfif>>#myquery.mycolumn2#</option>
</cfoutput>

if you want to use javascript after the fact:

document.myform.myselectbox.value="#jsstringformat(selectedvalue)#"

works at least in IE ... in some other browsers you may have to resort to

document.myform.myselectbox.selectedIndex =
#ListFind(valuelist(myquery.mycolumn),selectedvalue)#

If there's not an empty element at the top of your select box you'll need to
add -1 to the end of that line of javascript...

hth


Isaac Dealey
Certified Advanced ColdFusion 5 Developer

www.turnkey.to
954-776-0046

> yes,  I sure do.

> and I can do it fine, snagging the one I want selected
> and putting it first in the list, no problem, but I just wanted
> to keep the same order.

> ..tony

> Tony Weeg
> Senior Web Developer
> Information System Design
> Navtrak, Inc.
> Fleet Management Solutions
> www.navtrak.net
> 410.548.2337


> -----Original Message-----
> From: Tangorre, Michael [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, September 12, 2002 1:13 PM
> To: CF-Talk
> Subject: RE: select box focus


> Tony,

> I assume that you have a query or a variable to hold the item you want
> selected correct?

> -----Original Message-----
> From: Tony Weeg [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, September 12, 2002 11:22 AM
> To: CF-Talk
> Subject: sot: select box focus


> hi there.

> ok, I have a page, that when a user returns to it, there
> is a select box, and that select box could have any number of
> options in it.  without changing the order of the entries in it,
> I want to have the select box, show that entry in the veiwable
> area, not like 45 options down?  make sense? it's a select box
> that people can see 10 options on, and make multiple selections.

> tony

> Tony Weeg
> Senior Web Developer
> Information System Design
> Navtrak, Inc.
> Fleet Management Solutions
> www.navtrak.net
> 410.548.2337



> 
______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to