Link to home
Create AccountLog in
Avatar of sglee
sglee

asked on

CFSELECT in Coldfusion

User generated imageUser generated image
I have order form page with following select statement. Once the user selects the frequency (in this case, "Fill-In Order" and click [Order Preview] page, it shows the selected Frequency in drop-down menu format, but it fails to list all other choices. I like to be able display what the user selected plus the rest of the options from the table so that users can still make the change if they change their mind in Order Preview page.

--- OrderForm.cfm ---
<CFFORM  ACTION="PreviewOrder.cfm">
          <SELECT NAME="Frequency1">
                    <OPTION VALUE="0"></OPTION>
                  <CFOUTPUT query="GetFrequency">
                  <OPTION VALUE="#ID#">#Frequency#</OPTION>
                  </CFOUTPUT>
       </SELECT>

--- PreviewOrder.cfm ---

           <CFQUERY NAME="GetFrequency" datasource="Order">
                 SELECT      *
                    FROM         Frequency
               WHERE   ID = #Form.Frequency1#
            </CFQUERY>
            <CFSELECT NAME="Frequency1"
                   query="GetFrequency"
                   selected="#GetFrequency.ID#"
                   VALUE ="ID" DISPLAY="Frequency">
            </CFSELECT>
ASKER CERTIFIED SOLUTION
Avatar of gdemaria
gdemaria
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of sglee
sglee

ASKER

@gdemaria
That was it. Thank you for your help.