Solved

CFSELECT in Coldfusion

Posted on 2014-12-30
2
123 Views
Last Modified: 2014-12-30
Frequency Drop Down ListFrequency Drop Down List with Item Selected
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>
0
Comment
Question by:sglee
2 Comments
 
LVL 39

Accepted Solution

by:
gdemaria earned 500 total points
ID: 40523796
You want your query to fetch all values, so remove the where clause
You want the CFSELECT to highlight the FORM.Frequency1

 <CFQUERY NAME="GetFrequency" datasource="Order">
                 SELECT      *
                    FROM         Frequency
            </CFQUERY>
            <CFSELECT NAME="Frequency1"
                   query="GetFrequency"
                   selected="#Form.Frequency1#"
                   VALUE ="ID" DISPLAY="Frequency">
            </CFSELECT> 

Open in new window

0
 

Author Comment

by:sglee
ID: 40523946
@gdemaria
That was it. Thank you for your help.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Coldfusion 8 equivalent of the cf9 "new" 4 44
looping over JSON Object and insert into query 3 61
Airline check in kiosk 4 105
Detect and combat possible robot 7 107
The technique is by far very Simple! How we can export the ColdFusion query results to DOC file?  Well before writing this I researched a lot in Internet but did not found a good Answer anyways!  So i thought now i should share my small snippet w…
This is an updated version of a post made on my blog over 3 years ago. It is unfortunately, still very relevant as we continue to see both SQLi (SQL injection) and XSS (cross site scripting) attacks hitting some of the most recognizable website and …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question