macromedia.coldfusion.cfml_general_discussion
[Top] [All Lists]

cfoutput query within HTML Select

Subject: cfoutput query within HTML Select
From: "Libby H"
Date: Thu, 14 Aug 2008 16:51:27 +0000 UTC
Newsgroups: macromedia.coldfusion.cfml_general_discussion

I have am update screen that allows the users to update the 'payment date' on a 
record.  A simple query should load the available dates to be used to update 
this value.

 The value that appears on the screen is the current value of 
get_record.payment_date, but when you click on the drop-down arrow, you get all 
the values in the calendar table, not just the answerset from the query.  Any 
ideas why?





 Query:
 <cfquery name="get_record" datasource="#attributes.datasource1#" 
dbtype="ODBC"> 
        SELECT * from external_transaction
                WHERE sequence_number = #session.gdsequence_number# 
 </cfquery>

 <cfset session.today=#DateFormat(Now(),'mm/dd/yyyy')#>
 <cfquery name="calendar" datasource="#attributes.datasource1#"> 
        SELECT date
                FROM calendar 
        WHERE (calendar.date >= #session.today#) 
                AND calendar.type = 'B'
        order by date 
 </cfquery>

 Table entry (only part of it):
 <td align="right">Payment Date:</td>
                <td align="left"><select name="payment_date" size="1">
                        <cfoutput><option 
selected>#dateformat(get_record.payment_date , 
"MM/DD/YY")#&nbsp;&nbsp;#dayofweekasstring(dayofweek(get_record.payment_date))#<
/option></cfoutput>
                        <cfoutput query="calendar">
                                <option>#dateformat(calendar.date , 
"MM/DD/YY")#&nbsp;&nbsp;#dayofweekasstring(dayofweek(calendar.date))#</option>
                        </cfoutput>
                </select></td>


<Prev in Thread] Current Thread [Next in Thread>