Skip to main content
September 9, 2009
Question

Why won't cfselect fill the initial value?

  • September 9, 2009
  • 1 reply
  • 1270 views

I don't understand why the cfselect won't put in the initial value...

             <cfif #URL.form_action# EQ "update">

               <cfquery name="details">

               GET STATE QUERY

               </cfquery>

               <cfselect selected="#details.state#" name="states" bind="cfc:_kpcfc_select.get_states()" bindonload="true" required="yes" message="Please select the state."/><span class="red">*</span>

              </cfif>

    This topic has been closed for replies.

    1 reply

    Inspiring
    September 9, 2009

    How many records does the state query return?

    What is the value of url.form_action?

    Shouldn't your cfselect have a value attribute?

    September 9, 2009

    Query returns one record.  But I need it to be selected at first, and then the user will have the option to select a different one.

    url.form_action = "update"

    I thought it was "selected" I needed to enable... let me try "value=" instead.

    September 9, 2009

    value= did not work.