Skip to main content
July 16, 2009
Question

CFSelect - Bind - Selected

  • July 16, 2009
  • 2 replies
  • 4833 views

Lets say that I have the following:

<cfselect name="city" value="unid" display="city" bind="cfc:Examples.CFC.Geographic.getAllCities()" bindonload="true" onChange="submit()"  />

This will return all the countries in our system. When the form submits onChange, the value changes to the city at the top of the list.

How do I get the cfselect to default to the value selected when it was previously changed ?

This topic has been closed for replies.

2 replies

BKBK
Community Expert
Community Expert
August 19, 2009
How do I get the cfselect to default to the value selected when it was previously changed ?

<cfform preservedata="yes">

Inspiring
July 16, 2009

use the selected attribute

July 16, 2009

I attempt to pass a variable as the selected value, it always defaults to the top value returned from the cfc.

Inspiring
July 16, 2009

Is the variable you are passing one of the available values?