Skip to main content
June 18, 2009
Question

Populate a <cfselect> from existing value, and bind

  • June 18, 2009
  • 1 reply
  • 2419 views

I have a form that allows users to update existing info.  The form values populate based on data already stored in a table.

I want to load existing data into a <cfselect> and also have that bind to the next <cfselect>.  However, I want the next cfselect to initially populate with it's value in the db table.

So on the initial page load both cfselects would have the initial table data, but if the user changes the first one, the second one would auto update because it's bound with a cfc.

Can I do this?

    This topic has been closed for replies.

    1 reply

    Inspiring
    June 18, 2009

    Sounds like you are talking about related selects.  Those are possible.

    June 19, 2009

    I am using a related select already (cf8 and ajax).  I want to prepopulate the fields with the values the user originally added in the form.  They are coming back to update, so I want the value they inserted to be the first value.  If they change the value I want it to be like the original related select.

    Inspiring
    June 19, 2009

    cfselect has a selected attribute you can use.