Solved

CFSELECT in Coldfusion

Posted on 2014-12-30
2
131 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
[X]
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
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

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Create a dynamic query by creating and looping through an array with ColdFusion 3 49
Coldfusion RegEx 8 88
Coldfusion - rename files in a folder 4 32
Combining Queries 7 54
This article  is about submitting  form through  ColdFusion.Ajax.submitForm to the action page and send a response back in JSON format which later can be decoded using ColdFusion.JSON.decode. By this way you can avoid the usual page refresh for subm…
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 …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Suggested Courses

732 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