Solved

CFSELECT in Coldfusion

Posted on 2014-12-30
2
116 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
COLD FUSION 6 20
expandPath erroring 15 51
Coldfusion update database with CFLOOP 5 55
Browser back button refreshing coldfusion iframe 6 69
Hi, Even though I have created this Tutorial on My personal Blog, Some people might not able to find my website, So here i am posting it again Today, from the topic it is very clear that i will be showing you here the very basic usage of how we …
Sometimes databases have MILLIONS of records and we need a way to quickly query that table to return the results me need. Sure you could use CFQUERY but it takes too long when there are millions of records. That is why SOLR was invented. Please …
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

744 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now