Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

CFSELECT in Coldfusion

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Hi, I will be creating today a basic tutorial on how we can create a Mail Custom Function and use it where ever we want. The main advantage about creating a custom function is that we can accommodate a range of arguments to pass to the Function and …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

828 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