ColdFusion Language




Articles & Videos



ColdFusion is a server-side rapid application development platform originally created by Allaire and now sold by Adobe, implementing the dynamic general purpose CFML programming language. The term ColdFusion is sometimes colloquially used to refer to the CFML language (Cold Fusion Markup Language), but can also include discussions of the server software implementation. ColdFusion runs using a customised version of Apache Tomcat. Earlier versions are bundled with JRun.

Share tech news, updates, or what's on your mind.

Sign up to Post

I have a Cold Fusion form with a contract number field that needs more than one label. Current code is:

<label for="Contract_Number">Contract Number:&nbsp;</label>

Open in new window

How do I add another id so I can use the same validation for that form field? Would this work:

<label for="Contract_Number" for="Contract_NumberZ">Contract Number:&nbsp;</label>

Open in new window

Or how do I add the 2: This doesn't seem to work:

label for="Contract_Number"|"Contract_NumberZ">

Open in new window

Is Your DevOps Pipeline Leaking?
Is Your DevOps Pipeline Leaking?

Is your CI/CD pipeline a hodge-podge of randomly connected tools? You’ve likely got a tool to fix one problem & then a different tool to fix another, resulting in a cluster of tools with overlapping functionality. Learn how to optimize your pipeline with Gartner's recommendations

is it possible to set up a regex to validate each position in a string of characters in a form field?

I have a requirement for a contract number field in a Cold Fusion form. Requirements are:

•      Positions 1-6 will be the  70Z0XX where XX is the contracting office code IE: 23.
•      Positions 7-8 will be the two digit Fiscal Year IE: 17.
•      Position 9 will be the one character instrument code IE: C, D, F.
•      Positions 10-17 will be agency assigned number.
•      New Example: 70Z02317D00000001

Is it possible to set up an expression at different points w/in the string of characters? I've never done that...only length requirements and forcing it to start w/ either a number or a letter. thanks for any help.
I want to keep cookies alive even after restarting Coldfusion on the server each morning.  Screen-Shot-2017-06-21-at-8.51.25-AM.pngI am attaching the settings from Coldfusion.

Thanks for your help
I have one form field with a Cold Fusion form that is requiring 2 different sets of criteria for validation....can this be done?

I have 2 sets of criteria for a contract number field w/in a CF form field. One is requiring the contract number to begin with a numeric character the other alphanumeric. I currently have the one set that needs to start w/ a letter but need to add the validation using a regex to the same form field to trigger the field to validate for the additional set of criteria that requires the new contract number configuration to begin with a number.

Current setup for the validation is:

			, Contract_Number: {
				required: true
			   ,pattern: /^[DdFfGgHhNnVv][A-Za-z0-9]{1,21}$/

Open in new window

Form field setup:

                        	<font face="Arial" size="2" color="#990000">
                            <label for="Contract_Number">Contract Number:&nbsp;</label>
							 <input type="text" name="Contract_Number" id="Contract_Number" minlength="8"  maxlength="22" tabindex="7" value="<cfif structkeyexists(session.invoiceDataContr, "PASS")><cfoutput>#session.invoiceDataContr.Contract_Number#</cfoutput><cfelse><cfoutput>#form.Contract_Number#</cfoutput></cfif>" required/>
                        	<font size="1" color="navy" title="No hyphens or special characters, OF-347 block 2, SF-26 block 2, SF-1442 block 4, SF-1449 block 2, SF-33 block 2">(help)</font></font>

Open in new window

Is there a way to use a hidden field maybe? I'm not sure its even possible to do. This will need to use jquery for client but also needs server side validation as well.

I'm thinking I can use as try catch and w/in that use a cfif/cfelse setup:

Open in new window

hi, i have the following json Code:

{"WhoisRecord": { "createdDate": "1997-09-15T00:00:00-0700", "updatedDate": "2015-06-12T10:38:52-0700", "expiresDate": "2020-09-13T21:00:00-0700", "registrant": { "name": "Dns Admin", "organization": "Google Inc.", "street1": "Please contact, 1600 Amphitheatre Parkway", "city": "Mountain View", "state": "CA", "postalCode": "94043", "country": "UNITED STATES", "email": "", "telephone": "16502530000", "fax": "16506188571", "rawText": "Registrant Name: Dns Admin\u000aRegistrant Organization: Google Inc.\u000aRegistrant Street: Please contact, 1600 Amphitheatre Parkway\u000aRegistrant City: Mountain View\u000aRegistrant State/Province: CA\u000aRegistrant Postal Code: 94043\u000aRegistrant Country: US\u000aRegistrant Phone: +1.6502530000\u000aRegistrant Fax: +1.6506188571\u000aRegistrant Email:" }, "administrativeContact": { "name": "DNS Admin", "organization": "Google Inc.", "street1": "1600 Amphitheatre Parkway", "city": "Mountain View", "state": "CA", "postalCode": "94043", "country": "UNITED STATES", "email": "", "telephone": "16506234000", "fax": "16506188571", "rawText": "Admin Name: DNS Admin\u000aAdmin Organization: Google Inc.\u000aAdmin Street: 1600 Amphitheatre Parkway\u000aAdmin City: Mountain View\u000aAdmin State/Province: CA\u000aAdmin Postal Code: 94043\u000aAdmin Country: US\u000aAdmin Phone: 

Open in new window

I've been using's code in my Application.cfc file to check for malicious input through FORM and URL variables, but I'm running into issues with hyphenated variable names (specifically Google's reCAPTCHA.) This is the code I use:

<cfloop collection="#form#" item="formelement">
    <cfif isSimpleValue(evaluate(formelement)) AND refindnocase(sqlregex, "#evaluate(formelement)#")>
        <cflocation url="messages.cfm?message=invalid">
        <cfset StructClear(form)>

Open in new window

And this is the error I'm receiving:

Variable G is undefined.

Which makes sense, because it's looking at g-recaptcha-response. What do I need to do to my code to allow it to accept hyphenated variable names?

I am looking for a solution that uses CFSCRIPT to remove all text that is surrounded by '<style' and '/style>' including removing the style tags. Can someone show me how I can use something like ReReplaceNoCase to solve this.

For example: if I have text that looks like:

section a <style>here is style to remove</style>section b <style>more style to remove</style>section c

I need the function to return:
section a section b section c

Thank you.
Can I use ReReplaceNoCase or someother javascript function to  remove everything in a string from and including '<style' to '/style>'? What would the function call look like?
i have been searching on roads for best oracle fusion financials training institute. but i am not able to find the institute which opt for my requirement. where i can find best institutes details with complete details
We installed Coldfusion2016 on Windows Server 2012

On the server, the ColdFusion Administrator works flawlessly. The ColdFusion programs can be accessed without a problem when accessed on the server itself e.g. http://myServer:8500/CDM/customer/ /cfProgram1.cfm

However, when we access the ColdFusion programs from a PC on the network, we get error message.
HTTP Error 404.3 - Not Found The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.

We read on the internet it has something to do with IIS. However, we are not that familiar with IIS.

Any help is greatly appreciated
Free Tool: SSL Checker
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

I have the following sample code

<cfset testuser = {}>
<cfset = []>
<cfset[1] = "Test">
<cfset[2] = "Test2">
<cfset[3] = {}>
<cfset[3].name = "user 1">
<cfset[3].email = "">
<cfset[3].email = []>
<cfset[3].email[1] = "">
<cfset[3].email[2] = "">
<cfset[3].email[3] = {}>
<cfset[3].email[3].nameuser = "user 1user2">
<cfset[3].email[3].emailuser = "user">

<cfdump var="#testuser#">

<cfloop from="1" to="#arrayLen(" index="i">
  <cfset skdata =[i]>
  <cfdump var= "#skData#"> //
  <cfif isArray(skdata)>
  <cfloop collection="#skdata#" item="key">

Open in new window

I want to convert this code into a very simple flatten structure were i am using the following function to dobut that works only on first leveel ofstructs and does not consider arrays

<cffunction name="flattenStruct" access="public" output="false" returntype="struct">
	<cfargument name="original" type="struct" required="true"><!--- struct to flatten --->
    <cfargument name="delimiter" required="false" type="string" default="." />
	<cfargument name="flattened" type="struct" default="#StructNew()#" required="false"><!--- result struct, returned at the end --->
	<cfargument name="prefix_string" type="string" default="" required="false"><!--- used in the processing, stores the preceding struct names in the current branch, ends in a delimeter --->

	<!--- get this level's elements --->
	<cfset var names = StructKeyArray(original)>
	<cfset var name = "">
	<cfloop array="#names#" index="name">
		<!--- add name --->
		<cfif IsStruct(original[name])>
			<cfset flattened = flattenStruct(original[name], delimiter, flattened, prefix_string & name & delimiter)>
			<cfset flattened[prefix_string & name] = original[name]>

	<cfreturn flattened>

Open in new window

I am on ColdFusion version 9
Hi, Working on cfimage and trying to upload and resize and make image transparent from left to right like a gradient effect..

Like the Image starting from left will be good and till it reaches the right end point, it will be of gradient effect which will be white or transparent,

How can i fix it

I tried imageflip, imagetranspose but nothing seems to be working what i am trying
i m not able to access ColdFusion pages and admin page in our application. It is throwing 500 error with ROOT CAUSE:
coldfusion.server.ServiceFactory$ServiceNotAvailableException: The Debugging service is not available.

I m getting below info in the logs when starting CF server. We are using CF9 on unix server. Please help.

04/26 05:02:19 Information [main] - Starting scheduler...
04/26 05:02:19 Information [main] - Starting WatchService...
04/26 05:02:19 Information [main] - Starting debugging...
coldfusion.server.ParsingConfigFileException: [/export/home/web3b2/coldfusion/coldfusion9/lib/neo-debug.xml]coldfusion.wddx.WddxDeserializationException: WDDX packet parse error at line -1, column -1. Premature end of file..
      at coldfusion.server.ServiceBase.doDeserialize(
      at coldfusion.server.ServiceBase.access$000(

04/26 05:02:19 Error [main] - Unable to initialize Debugging service: coldfusion.server.ServiceException: [/export/home/web3b2/coldfusion/coldfusion9/lib/neo-debug.xml]coldfusion.wddx.WddxDeserializationException: WDDX packet parse error at line -1, column -1. Premature end of file..
Dear Guys,

I am having issue on protocol in Adobe ColdFusion application. I tried changing it manually on applicationlib.cfm file, but its not reflecting on the browser.

Do I need to build the application after making changes or any other method need to be followed?

Please help on this.
ColdFusion CFSelect will not bind and return the Selected Value in ColdFusion 11.... It works fine in ColdFusion 8 and 9, but when put on CF11 it will not work

Here is the code.

<cfselect name="Field1" id="Field1" value="" bind="cfc:cfc_Field1DrillDown.lookupField1({Field1Desc},'#vField1Category#')" bindonload="YES" />

The CFC:

<cfcomponent output="false">
      <!--- Lookup used for auto suggest --->
      <cffunction name="lookupField1" access="remote" returntype="array">
            <cfargument name="vField1Desc" type="string" required="true">
            <cfargument name="vField1Category" type="string" default="" required="false">
            <!--- Define variables --->
          <cfset var data="">
          <cfset var result=ArrayNew(2)>
          <cfset var i=0>
            <!--- Do search --->
            <cfquery datasource="#Request.FieldDSN#" name="data">
                  SELECT QueryFieldID, QueryField
                  FROM FieldNames
                  WHERE (SICDefinitionID = '#ARGUMENTS.vField1Desc#')
                  ORDER BY QueryField
            <cfif data.recordcount IS 1>
                    <cfset result[1][1]=data.QueryFieldID>
                      <cfset result[1][2]=data.QueryField>
                        <cfset result[1][3]=IIF(ARGUMENTS.vField1Category eq data.QueryFieldID,DE(true),DE(false))>
                  <cfset result[1][1]="N/A">
                <cfset result[1][2]="">
                  <cfloop index="i" from="1" to="#data.RecordCount#">
                    <cfset result[i+1][1]=data.QueryFieldID[i]>
                        <cfset result[i+1][2]=data.QueryField[i]>
                        <cfset …
- ColdFusion 11 offers the following solution for concurrent sessions but I'm running CF 10 w/ little chance of upgrading at this time. Anyone have a workaround for CF10 that would accomplish the same thing w/ as little code as possible?
            applicationToken = "token"
            cookieDomain = "domain"
            idletimeout = "value"
            allowconcurrent = "true|false"    <----- available in CF11
            usebasicauth = "true|false">
We are facing an issue with verity collection going down in two instances of a server but it works in third instance. Collection is in same shared path in the server. Each time we have to run the instance specific url to delete and recreate the collection. Can anybody suggest what can be the root cause of this. We are using CF9 and unix server.
Coldfusion Basic handling error Using CFTRY, CFCATCH, CFTROW, CFFINALLY
I need a reset button to work w/in a Cold Fusion form without javascript as it has be functional without js turned on. Does anyone have any ideas? links to options? examples?
On Demand Webinar: Networking for the Cloud Era
On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Can anybody help me to run mailx command through coldfusion. There is some problem with our cfmail settings and we need to send the mails using mailx command? is this possible in CF?
Is there anyway to check if the CF server is running fine or have gone down ? I want to notify my team if the server is gone down.
CF version : 9 & 5
OS : unix
If I want to exclude subfolders inside the folder name mysitefolder from my search results. What should I do? thanks.

      key="\\mysitefolder \"
      extensions=".html, .htm, .cfml, .doc, .pdf, .xls, .xlw, .pps, .ppt"
Following a PHP Code, I tried to make it work in Coldfusion, I think i made everything correct, not sure why it is still throwing an error:

PHP Code:

 $jsonInvoice = json_encode($invoice);
    $data = array(
            'authtoken'   => '[Auth Token]',
            'JSONString'   => $jsonInvoice,
            "organization_id"  => '6217732',
            "send"                  => 'false'
    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
    curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/x-www-form-urlencoded") );

Open in new window

ColdFusion Code;

**jsondata = json encoded data**

<cfhttp method="post" url="">
        			<cfhttpparam type="header" name="Content-Type" value="application/form-data">
        			<cfhttpparam type="body" value="#jsondata#">

Open in new window

i found this piece of code from php,

public function createInvoice($customerId) {
        $fields = array(
        'customer_id' => $customerId,
        'date' => date('Y-m-d', strtotime($this->data['invoice_data']['c_users_invoices_created'])),
        'payment_terms' => 1,
        'due_date' => date('Y-m-d', strtotime($this->data['invoice_data']['c_users_invoices_created'])),
        'salesperson_name' => $this->data['sales_person'],
        'line_items' => array(0 => array(
        'name' => $this->data['invoice_data']['storitev'],
        'quantity' => 1,
        'rate' => $this->data['invoice_data']['s_prices_price'],
        "tax_name" => 'GST',
        'tax_type' => 'tax',
        'tax_percentage' => '10',
        'tax_id' => '545360000000039001',
        "payment_made" => $this->data['invoice_data']['c_users_invoices_amount'],
        "payment_options" => array("payment_gateways" => array(0 => array('gateway_name' => 'paypal'))),
        "gateway_name" => "paypal",
        "exchange_rate" => 1.00,
        $response = $this->sendRequest('invoices', $fields, 'POST');
        return $response->invoice->invoice_id;

Open in new window

what can i do to convert it into coldfusion please guide
I'm trying to drive a sub report off of a CFC that only get the data needed for the subreport.

                    <cfreport template="rptWorkOrders.cfr" format="pdf" query="wolist" overwrite="yes" encryption="none" permissions="allowprinting">
                        <cfreportParam subreport="WOItemDetail" query="cfc.Application.Support.getWO2PrintItems('#param.WO#', '#session.userauth.subid#')">

I get the error Element WO is undefined in PARAM.  WO is the name of the param defined on the main report to be passed to the subreport.

Basically I  have a query (WOLIST) that drives the main report; for each report, I need to print a sub report with just the items related to the parent report, the field on the cfr that links the two is called wo.  I want to use that to call a cfc on the subreport for the query to drive the subreport.
Back button w/in a page w/o javascript? is it possible to change a back button sitting w/in a page from using javascript to straight html? I know back buttons aren't advisable when you have the browser's back button but I've been asked to try and keep things as they currently are. The current button takes a user back after they fail a test for a pdf being uploaded that's too large.

Code snippet:

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<script type="text/javascript">
 function goBack()
<style type="text/css">


<body bgcolor="#FFFFFF" >
<table width="100%" border="0">
    <td align="center"><span class="style7"> <br>
      NOTICE! The File You Tried To Upload Exceeds 3MB And Is Too Large!</span><br>
       <span class="style9">Please reduce the file size within Adobe Acrobat and try uploading again. </span><br>
<input type="button" value="Back" onClick="window.history.go(-2)" />


ColdFusion Language




Articles & Videos



ColdFusion is a server-side rapid application development platform originally created by Allaire and now sold by Adobe, implementing the dynamic general purpose CFML programming language. The term ColdFusion is sometimes colloquially used to refer to the CFML language (Cold Fusion Markup Language), but can also include discussions of the server software implementation. ColdFusion runs using a customised version of Apache Tomcat. Earlier versions are bundled with JRun.