Category Archives: Coldfusion

cfselect and query values

Similar to binding to a cfc but binding with a query on the same page. Notice the query and value attributes and how they relate to the query. I added an ” All” as a default. <cfquery name=”get_last_names” datasource=”mydsn”> select … Continue reading

Posted in Code, Coldfusion, Snippets | Comments Off on cfselect and query values

Coldfusion cfoutput grouping

The cfoutput tag has a group attribute that lets you group your data for reports. The outer most cfoutput must have the query name and the group but the inner groups can not have the query name. In the following … Continue reading

Posted in Code, Coldfusion, Snippets, SQL | Comments Off on Coldfusion cfoutput grouping

The problem with setting defaults

Suppose you have a nice little yes/no selector on a form. And while you are testing you set the default value as “n”. Someday someone will come along and switch all the values to “y” in your database, and you … Continue reading

Posted in Coldfusion, Problems & Fixes | Comments Off on The problem with setting defaults

Coldfusion and Pausing Javascript

I had an interesting problem this week. I had a page with a CFQuery, a CFLoop to output the query, and a javascript function. The problem was that the javascript function was occurring before the loop would draw the output. … Continue reading

Posted in Code, Coldfusion, Javascript, Problems & Fixes, Snippets | Comments Off on Coldfusion and Pausing Javascript

looping over Arrays

Yippee we can now easily loop over arrays in CF8. <cfloop array=”arrayname” index=”i”> <cfoutput>#i#</cfoutput> </cfloop> #i# will show us the values in the array. You can ofcourse apply logic to the output so that dates an numbers are formatted.

Posted in Code, Coldfusion, Snippets | Comments Off on looping over Arrays