Setting a form select value while using CF bind


I can get the first select to work using the cfif statement...

<option value="#lastState#" <cfif #laststate# eq '#cookie.state#'>selected</cfif>>#titleCase(lastState)#</option><br />

However, I don't know what to use as a variable to check the variable...

 <cfselect name="city" bindOnLoad="Yes" bind="cfc:city.getCity({state})" class="inputForm" <cfif city.getCity eq '#cookie.city#'>selected</cfif> />
monosythAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

_agx_Commented:
That should work for CF9. AFAIK it's not built into CF8.  For CF8, you need to use a work around like this:
http://www.coldfusionjedi.com/index.cfm/2007/8/7/Selecting-default-items-using-ColdFusion-8s-AJAX-Controls
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
monosythAuthor Commented:
hmm, couldn't get that example to work with my code... any help using my existing code?
0
monosythAuthor Commented:
Perfect, had some extra help to figure this out. Thanks!
0
_agx_Commented:
Related selects are a little more complicated, because you have to wait for the bind to the other field {state}.. to complete first.  Did you see fix mentioned in the comments section (#13)? I think that should work in either scenario.
http://www.realitystorm.com/experiments/coldfusion/cfselect.cfm
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development Software

From novice to tech pro — start learning today.