Menu
  • HOME
  • TAGS

ColdFusion cfmail how do I keep the formatting

email,coldfusion

If you're not including the attribute type="html" in your cfmail tag, that could be affecting the formatting of your email. Also, within the cfmail tag, embed your style within in addition to your content. For example: <cfmail from="[email protected]" to="[email protected]" subject"test" server="mymailserver" type="html"> <html> <head> <style> .test { color: ##cc0000; }...

Create a simple unit tests framework from scratch in Coldfusion

unit-testing,coldfusion,frameworks,coldfusion-9

In answer to your question, it sounds like you want to inject variables / methods into the subject under test. You can do it like so: myInstance["methodName"] = myFunction; You can then call the injected method like so: myInstance.myFunction(); Both MXUnit and TestBox use this technique. Having said that I...

Date Picker format vs Database timestamp

sql-server,date,coldfusion

First off, always use cfqueryparam in your queries when dynamically including content. Second, you should be able to use start_date "as is" to compare the date to the date in the database So, something like: <cfquery name="sortDate" datasource="RC"> SELECT * FROM my_db_table WHERE Submission_Date > <cfqueryparam value="#start_date#" cfsqltype="cf_sql_date"> </cfquery> Last,...

Coldfusion CFGRID started showing as empty

coldfusion,coldfusion-8

Assuming that, you are using the latest version of ColdFusion(CF 11), I tried with querysetcell and your cfgrid code. The below code works in all browsers. <cfset rsPages = querynew("pageID, pageCountryID, pageLanguageID, pageName, pageTitle")> <cfset queryaddrow(rsPages, 3)> <cfset querysetcell(rsPages,"pageCountryID","Country1",1)> <cfset querysetcell(rsPages,"pageLanguageID","Language1",1)> <cfset querysetcell(rsPages,"pageName","Page1",1)> <cfset querysetcell(rsPages,"pageTitle","Title1",1)>...

Regex prefix lookaround not working in coldfusion 10

regex,coldfusion,coldfusion-10

You're missing the bit about reading the docs ;-) - Regular expression syntax - Using special characters - Look behinds & arounds are not supported in CFML's flavour of regex (which is long-dead Apache ORO). However it's easy enough to use java's regex implementation instead, which does support look-behinds: java.util.regex.Pattern...

Data Link Escapes and Other Nonprintable Characters

coldfusion,sublimetext3,control-characters

In general these can be created with the chr() function. It is useful for creating many the non printable characters. One of the more common usages is to crea See: https://wikidocs.adobe.com/wiki/display/coldfusionen/Chr As for DLE, you can <cfset DLE = chr(16)> Another common usage is to create Carriage Return / Line...

Fusebox cannot identify the controller

coldfusion,cfml,railo,cfc,fusebox

This may be caused by a conflict between a UDF in Fusebox and a built-in function with the same name in Railo/Lucee. Try searching the entire Fusebox folder for getCanonicalPath and replacing each occurrence with getCanonicalPathUdf....

Hashed password sometimes longer than 128 characters

coldfusion

It seems from your error that the issue is at a database level, as ColdFusion is not failing your maxlength check on the cfqueryparam tag and is allowing the query to be executed. I just tested trying to pass a string that exceeds the length specified in the maxlength attribute...

How to write a Javascript function to update a Coldfusion form display

javascript,jquery,coldfusion,coldfusion-9

The solution to this is as follows: Change the form type from Flash to HTML. Eliminate the CFformlayout tags as they will just create a bigger headache than necessary. The following code provides a working coldfusion function and javascript call: AJAX: <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script> <script language="javascript"> $(document).ready(function() { $("#createReport").click(function(f) {...

Display single digits with leading zero

coldfusion

You can use numberFormat. <select id="minutes"> <cfoutput> <cfloop from="1" to="60" index="m"> <option>#numberFormat(m,'00')#</option> </cfloop> </cfoutput> </select> See also this runnable example at trycf.com....

Assigning Loop Number to a Phrase

coldfusion

Your best bet assuming the count can't up too high is to create an array to pull in the name numberMapping = ['First','Second','Third','Fourth','Fifth','Sixth']; Then update your owner to pull based on your array <legend>Owner <cfoutput>#numberMapping[Peoplecount]#</cfoutput>'s Information</legend> ...

SublimeText 3 - Package Control: Removed directory for orphaned package ColdFusion

coldfusion,sublimetext3,sublimetext,sublime-text-plugin

The "Download Manually" section is for Sublime Text 2 only. At the very top of the README you linked are the ST3 instructions: The development branch contains a rewrite of the ColdFusion plugin. The only installation method is via Git. cd Packages/ git clone https://github.com/SublimeText/ColdFusion.git cd ColdFusion git checkout development...

How to get raw binary from hash function in ColdFusion 9?

coldfusion,coldfusion-9,sha

Since you know the hashed string is in hex, simply decode it with the aptly named binaryDecode() function. hashedString = hash("bob", "SHA1"); binaryData = binaryDecode(hashedString , "Hex"); ...

How to write Russian characters to file with cffile

coldfusion,io,character-encoding,coldfusion-10

Set the charset = "utf-8" when writing to the file

How to get old Coldfusion MX7 Serial Number In FileSystem

coldfusion,serial-number,coldfusion-7

Details from this forum discussion here: https://forums.adobe.com/thread/1154153 Find the [cf_root]\lib\license.properties file. The serial number is on the line beginning sn=...

How to check at least 1 check box is check before submitting form? [duplicate]

coldfusion

Assuming you're using jQuery, you can do the following: // when the form submit event occurs $("#confrm_key").submit( function( event ) { // if we don't have any checked checkboxes if ( $(this).find(":checked").length === 0 ) { // throw an alert alert( "Warning message here." ); // and stop the submission...

getting result metadata from coldfusion newQuery() in cfscript

coldfusion,cfquery

You are getting the result property of the query first and then from that you are trying to get the prefix property in result. But this is not the case. You can directly get the prefix property and then the generated key like this: tmp.getPrefix().generatedkey; For reference you can check...

ColdFusion logging vs performance

coldfusion,coldfusion-8

It's a very subjective question and depends on your settings, architecture and loads. Generally, logging takes a very small portion of your server's processing in comparison to everything else it does, however the amount of logging and your log retention policy can affect your server's performance if not tuned properly....

Disappearing content in HTML Layout of Coldfusion Datagrid

html,css,coldfusion,coldfusion-9

Solution: I was able to fix this issue by the following: Place my CF layout block at the top of my page, Copy my div with the 3 form elements and put it back at the top. Save it. Delete the duplic div block at the botton. Code: <!---This begins...

Run a cfquery inside of a query output

sql-server,coldfusion,cfquery

(Expanded from comments ...) <cfoutput>startStamp</cfoutput> Not sure what you are trying to accomplish, but you should get rid of the inner cfoutput tags. Those are only needed when using the (frequently misunderstood) <cfoutput group="..."> feature. It is normally used to eliminate duplicates from sorted data. However, if the data is...

Match a single senerio with ANTLR and skip everything else as noise

java,parsing,coldfusion,antlr

You can use lexer mode to do what you want. One mode for property and stuffs and one mode for noise. The idea behind mode is to go from a mode (a state) to another following token we found during lexing operation. To do this, you have to cut your...

Using iText to save pdf to ColdFusion Variable

pdf,coldfusion,itext

Leigh's comment about using ByteArrayOutputStream was the correct answer. Here is the updated code that works placing the generated PDF into a ColdFusion variable: <cfset var document=createObject("java", "com.lowagie.text.Document") /> <cfset var PageSize=createObject("java","com.lowagie.text.Rectangle") /> <cfset var fileIO=createObject("java","java.io.ByteArrayOutputStream") /> <cfset var writer=createObject("java","com.lowagie.text.pdf.PdfWriter") /> <cfset var paragraph=createObject("java",...

ArrayResize() creates undefined objects

arrays,coldfusion,coldfusion-11

Just don't use ArrayResize() for such a small array. It is meant for LARGE arrays. Anyway, that's how it works, what do you expect? Anyway, there's ArraySet() if you really need it. https://wikidocs.adobe.com/wiki/display/coldfusionen/ArraySet...

Pass List of Integers to Stored Procedure

sql-server,coldfusion

rodmunera's answer has the correct general idea. Here is how I finally got it to work. In sql server, I started with this: CREATE TYPE pt.IntegerTableType AS TABLE ( integerIN int); grant execute on type::pt.IntegerTableType to theAppropriateRole Then I changed by stored proc to this: ALTER PROCEDURE [dbo].[Dan] @numbers pt.IntegerTableType...

How Do you Reference Coldfusion Instances in Clustered Server Environment

coldfusion,instance

Two methods I've used are to either include an HTTP header in the response, or an HTML comment that outputs the name of the server so you can view it with debugging tools. No, on to your specific question about the instance, you haven't said what ever of CF engine...

ColdFusion Component Not Returning Query

coldfusion,cfc

Your cfinvoke is missing a returnVariable <cfinvoke component="queries" method="EmployeeQuery" returnVariable="EmployeeAdd"> <cfinvokeargument name="EmployeeID" value="#form.txtEmployeeID#"> </cfinvoke> <h3>Confirm Employee Entered</h3> <cfoutput>#EmployeeAdd.displayName#</cfoutput> Alternatively if you're on CF10 or higher you could do this instead of your cfinvoke <cfset employeeAdd = new queries().EmployeeQuery(form.txtEmployeeID)> ...

Parameterize ORM query with where in clause

hibernate,orm,coldfusion

In HQL (which is what you use when you do ORMExecuteQuery() ) parameters used in an IN clause need to be passed as an array. You need to convert form.deleteAwardList to an array. There are a few different ways to handle this, but this will work. qryAwards = ORMExecuteQuery( "from...

Error Executing Database Query (issue with WHERE clause?)

sql-server-2008,coldfusion

It's because the way you're building your SQL statement you've got values hard-coded amongst the SQL itself, ie: <cfset strWhere = " WHERE SCHYEAR = '#Form.yrVal#'"> This has both SQL in it: WHERE SCHYEAR = and a value: '#Form.yrVal#'. One shouldn't really do that, and indeed when your values are...

Schedule a task to run monthly the second week?

coldfusion,coldfusion-9

You could always set it to trigger every seven days from a tuesday and place this in the top of the job The first date of the month that can be a second occurrence is the 8th, the last is the 14th. <cfif dayofweekasstring(dayofweek(now())) is "Tuesday" and day(now()) lte 14...

jQuery AJAX and functions in a CFM file

javascript,jquery,ajax,coldfusion

You really should use cfcs for this If for some reason you can't do the above, you would need to add a cfscript block on the cfm page to call the function. You could have a case or an if statement to call the abc function based off what is...

Use java class in ColdFusion11 - The java object type is unknown for the CreateObject function

coldfusion,coldfusion-10,railo,cfwheels

Ah thanks all. As haxtbh said in the comments, the problem was Adobe CF's createObject only has two arguments. The type and the class. So I needed to put: this.javaSettings = { LoadPaths = ["/miscellaneous"] }; in /config/app.cfm and then use CreateObject( "java", "BCrypt" ); in /events/onapplicationstart.cfm ...

Regex Base64 image with headers

regex,coldfusion

You may notice in the original regex the use of [square brackets], these create character sets matching any character within so [data:image/png;base64,] will match d,a,t,a,....,6,4,,. Instead, you may want to create a non-capturing group because I think you're trying to make the header optional, like this (?:data:image/png;base64,)? ^((?:data:image/png;base64,)?[A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$ ^ #...

executing cfquery in cfc with parameters received via AJAX [duplicate]

javascript,ajax,coldfusion

Give this a try: <cfquery name="query" datasource="phonebook"> SELECT '#select#' FROM '#from#' WHERE '#where#' ORDER BY '#orderBy#' </cfquery> As I recall from my research, putting the quotes around the variables tells coldfusion that it should process those values in a sql-like manner. That is, it won't escape the quotes you are...

How to get list of valid tags of Jsoup whitelist?

java,coldfusion,jsoup

If you want to go the reflection route, you can do something like below which grabs access to the tagNames set, converts it to an array of org.jsoup.safety.Whitelist$TagName objects (which contain the tag names) and then appends the toString() values of those objects to another array. <cfscript> whitelist = createObject("java",...

How can I send this XML request to my server and have it send to and get a response from another server

xml,https,coldfusion

Try this... First, save the packet. <cfsavecontent variable="theXMLPacket"> <cspinput appID="asdfasdf" appPassword="asdf1234" > <account userid="johndoe" action="authenticate"> <password>mypasswd1234</password> </account> </cspinput> </cfsavecontent> Then we use cfhttp to post it to the processing server. <cfhttp method="post" url="https://someurl.com/endpoint" result="xmlResult"> <cfhttpparam type="xml" value="#XMLParse(theXMLPacket)#" /> </cfhttp> Then process the...

JSOUP - How to get list of disallowed tags found in html?

coldfusion,jsoup,whitelist

I don't believe there's a direct function in jsoup to get a list of the invalid elements based on your whitelist. You'd have to roll your own. It's not overly complicated. You can still work from a Document object, select all of the elements and then individually check them against...

Convert Special Characters to HTML - ColdFusion

coldfusion,coldfusion-11

You're using CF11, did you try EncodeForHTML() ?

Read substring between two strings CF

regex,coldfusion,coldfusion-9

You are on the right track.. just make your .* greedy by adding ?.. and exclude trailing space by adding \s* after it. actuals_ADAPS_20150517_3\.t&gt;<\/A>\s*(.*?)\s*4k See DEMO...

using a coldfusion variable in a javascript function name

javascript,coldfusion

You can do this: <script type="text/javascript"> <cfoutput> function name#id#() </cfoutput> </script> But it is more likely that you want to do this: <script type="text/javascript"> <cfoutput> name(#id#) </cfoutput> </script> ...

code optimizing in coldfusoin, as String are immutable in Coldfusion

coldfusion,coldfusion-9

This would perhaps be an approach. it's a complete stand-alone repro, but the bit you want to look at is the listAppend() stuff: <cfscript> qRoute = queryNew(""); queryAddColumn(qRoute, "a", "varchar", ["","a2","a3","a4"]); queryAddColumn(qRoute, "b", "varchar", ["","","b3","b4"]); queryAddColumn(qRoute, "c", "varchar", ["","","","c4"]); </cfscript> <cfloop query="qRoute"> <cfif not len(qRoute.a)> <cfcontinue> </cfif> <cfset str =...

Change the List delimiter to something new

coldfusion

That is the definition of delimiter. Anyway, it is relatively easy to fix, just add the last one yourself. <cfset foo="t,u,n,f,o,a,c,r,v"> <cfset msg = ListChangeDelims(foo,'="",')> <cfset msg &= '=""'> <cfoutput>#msg#</cfoutput> http://trycf.com/gist/4ac3702b74bd79b5d1f8/...

Scan folder and output all file names in coldfusion

coldfusion

You aren't looping over files... It returns an object to iterate over... An query I believe. So loop like the following <Cfoutput query="Files"> #Files.name# <br> </cfoutput> ...

Concatenate form element name with coldfusion counting variable

forms,coldfusion

You're mostly there <cfqueryparam cfsqltype="cf_sql_char" value="#form['setID' & i]#"> ...

SQL ID from table posts same ID to all other coldfusion entries per transaction

sql-server,coldfusion

When using cfquery you can use the results attribute to return information based on the query that was run. One part of this information is GENERATEDKEY. You can then assign this GENERATEDKEY to a variable and use it later in your code. So first you need to add the result...

cgi.SERVER_NAME reverts origin

coldfusion

If you are storing it in an application scoped variable then users can change the variable mid request. You don't see this on your dev server because you don't have any concurrent users. Assume you have a request to en.website.com then 1 millisecond later a request to es.website.com both requests...

Could not identify the datetime string

datetime,coldfusion

It looks like ISO 8601 format. The part up to the letter T is the date in yyyy-mm-dd format. The letter T separates the date and time components. The time is HH:mm:ss followed by fractions of a second to 7 decimal places. The -04:00 is the offset from UTC....

Get total time and create an average based on timestamps

math,time,coldfusion

Assuming your query is sorted properly, something like this should work. totalMinutes = 0; for (i = 2; i <= yourQuery.recordcount; i++) totalMinutes += DateDiff('n' , yourQuery.timestampField[i-1] ,yourQuery.timestampField[i]); avgMinutes = totalMinutes / (yourQuery.recordcount -1); ...

CFPDF with PNG: transparency is black. With PDF it's white

pdf,coldfusion,thumbnails,watermark,cfpdf

I found a fix to my own issue. The best way that I found to accomplish this was to created the PDF's into images and then use Coldfusion's imaging to add the watermark to the images. <cfloop query="jpgfiles"> <cfset theFile = directory & "/" & name> <cfset imgFile = imageRead(theFile)>...

CFZip of certain file type

coldfusion,cfzip

Steve already pointed you to the CF documentation which has example of delete. To create a zip, the simplest way is as follows: <cfset fileName = createUUID() /> <cfzip file="D:\#fileName#.zip" action="zip" source="D:\myfolder" filter="*.bak" recurse="No" > If you want to add the files of a sub-directory, then make recurse="yes". To filter...

ColdFusion: Query VS Structures

performance,optimization,coldfusion,structure,cfquery

Query of queries is actually pretty slow compared to an SQL query as it doesn't have any concept of indexes or execution plans so you need to be careful before going down that route as you could well end up with a slower more intensive process. Database engines are optimised...

Compressing a PDF document generated by coldfusion

pdf,coldfusion,coldfusion-8,pdf-conversion

CFDocument generates bloated PDFs. We tested GhostScript and used the following parameters to compress a 22.3mb PDF to 4mb. (If set to "screen", the file size shrunk down further to 2.5mb.) http://www.ghostscript.com/ To use this, you'll have to perform this optimization as an extra step after the generation of your...

Coldfusion 9 serializeJSON()

json,coldfusion,adobe,coldfusion-9,cfml

You can disable this in the ColdFusion administrator. Go to Server Settings > Settings and uncheck Prefix serialized JSON with There are, however, security implications if you turn this off. This helps protect your JSON data from cross-site scripting attacks and is explained more in depth in this StackOverflow answer...

Is there a way to add numeric values together in a string without looping?

coldfusion,coldfusion-9

Sure.. just for fun. digits = 212; sum = arraySum(listToArray(digits, "")); writeOutput(sum); Run script above: http://trycf.com/gist/3677b4e7d17d4fbac37d/acf...

using a query as an argument to a cffunction

coldfusion,cffunction

The version of the question that I posted wasn't actually a carbon copy of the function in the source file. The function in the source actually had some <cfargument> tags (the first one being name="select") that were commented out. I was commenting them like this: <!-- a comment --> which...

Github pages/Jekyll Coldfusion redirect

redirect,coldfusion,jekyll,url-redirection,github-pages

Sorry but: any index.cfm is returned as an application/octet-stream file so it's understood as a file to be downloaded. any url query string like toto.html?q=myQuery will be totally ignored by your static site. Query string is supposed to be interpreted server side, so any query string after toto.htm will always...

Get count of specifc rows returned in cfquery

sql-server,coldfusion,cfquery

You have a couple of options. You could loop over the query with a counter that you increment when status = "Complete" or you could use a query of queries: <cfquery name="mynewquery" dbtype="query"> SELECT status, COUNT(*) AS status_cnt FROM myquery GROUP BY status </cfquery> Another way to do this, however,...

Converting a json looking simple value string to a ColdFusion structure

coldfusion,stripe-payments

Something's wrong in your CF or web server setup. I tested your json with CF11 on tryCF and it works. <cfscript> json = '{ "id": "ch_6HAwRK92OsQPoA", "object": "charge", "created": 1432149035, "livemode": false, "paid": true, "status": "paid", "amount": 100, "currency": "usd", "refunded": false, "source": { "id": "card_6HAwNGtbdzFdq0", "object": "card", "last4": "4242",...

Process ColdFusion Form with Component

forms,function,methods,coldfusion,cfc

A simple way to accomplish what you appear to want is to submit the form to the page containing it. No ajax required. <cfif StructKeyExists(form, "aKnownFormField")> code to process form can use create object to access cfc code if you want </cfif> <form action="thePageIAmOn.cfm" method="post"> <input name="aKnownFormField" type = "text">...

Remove duplicates from a list in CF10

coldfusion,coldfusion-10

The cfoutput you are expecting should have company=&state= as well. As they are distinct too. So taking this in account you can give this a try: <cfset url = "http://website.com/abc.asp?type=298&action=SUBMIT&product=&contribution=&rateTerm=&surrYr=&mva=&rop=&sortBy=1&sortOrder=2&pagenum=3&company=&product=&state=&contribution=&rateTerm=&surrYr=&mva=&rop="> <!--- Get domain name and query string ---> <cfset domainName = listGetAt(url , 1, "?")>...

How to get the recordcount of JSON results returned from Coldfusion Component?

json,coldfusion

Unless there is something you are not telling us, you do not need to include an extra row count. It can be derived from the result. By default serializeJSON(queryObject) returns a structure with two keys: DATA and COLUMNS (both arrays). DATA represents the rows in the query. So to obtain...

How to identifiy date string vs date object

coldfusion,coldfusion-10

You can leverage the fact that all CFML objects are also Java objects, and use Java methods: myDateString = '2015-05-05'; myDateObject = createDate( 2015, 5, 5 ); writeOutput(myDateString.getClass().getName()); writeOutput("<br>"); writeOutput(myDateObject.getClass().getName()); This yields: java.lang.String coldfusion.runtime.OleDateTime ...

Coldfusion REST service not found error

rest,coldfusion

The problem was in port. If the rest URL contains port 8500, everything is OK.

Get number of files in various subdirectories relative to the current page - ColdFusion

coldfusion,directory,cfdirectory

This code should work. <cfoutput> directory="#GetDirectoryFromPath(GetTemplatePath())#" </cfoutput> <cfdirectory directory="#GetDirectoryFromPath(GetTemplatePath())#" name="myDirectory" sort="name ASC, size DESC, datelastmodified" recurse = "yes"> <!---- Output the contents of the cfdirectory as a cftable -----> <cftable query="myDirectory" colSpacing = "10" htmltable colheaders> <cfcol header="Count" align="left" width="20" text="#recordCount#"> <cfcol header="NAME:" align = "Left" width = 20...

ColdFusion ~ Class must not be an interface (OSX only)

java,osx,coldfusion

The direct access could be working for some of the classes and not for others because the ones it is not working for may be expecting helper classes to be in the classPath. Adding the path to the location of your Google API Java files to your jvm.config file (example...

Build a dynamic cfquery using if statements - ColdFusion

sql-server,coldfusion

You don't need commas in the WHERE clause - it's not valid SQL. When building dynamic SQL WHERE clauses, then a quick tip is to just have a 'dummy' where clause. Here's a quick example (I've not included all your clauses): <cfquery name="reportInfo" datasource="DataSource1"> SELECT * FROM Basic_Info WHERE 1...

Can I Use the same certificate for Token Security and Protocol Security in SAML2?

java,coldfusion,coldfusion-11,saml2

Can you? Yes. Should you? No. It's better to use a self - signed cert than to share them. I can't tell you the number of times I've seen an admin screw up and send out their private key for their HTTPS cert.

Decoding Base64 to an Image in ColdFusion

javascript,coldfusion,cfml,topaz-signatures

As your binary data doesn't have image headers(Contains Mime type e.g. data:image/png;base64 for png image) so you can simply use imageReadBase64 like this: <cfset image = imageReadBase64(form.SigImgData)> <cfimage source="#image#" destination="c:\Inetpub\wwwroot\signatures\#fullfilename#.bmp" action="write"> I tried it locally with same code. Is this your image? ...

Form Data Not Being Sent In ColdFusion

forms,coldfusion

You need to enclose the userid between cfoutput so that it can be evaluated. Or better just wrap the form inside cfoutput. <cfoutput> <form action="storage.cfm" method="POST"> <input type="hidden" name="userId" value="#userId#"> <label>First Name:</label> <input type="text" name="firstName" value="#firstName#"> <label>Last Name:</label> <input type="text" name="lastName" value="#lastName#"> <label>Address:</label> <input type="text" name="address" value="#address#">...

How to remove � in Coldfusion JSON?

json,coldfusion

I have tried the same piece of code with another query. It is working fine. Try dumping the query. If it is ok, then you might have some encoding issue. Please ensure that the encoding method is causing the problem.

What is the correct syntax to test whether a structure key and data exists?

coldfusion,coldfusion-10

You need to put pound ## signs around SomeID as it is a variable. if (structKeyExists(APPLICATION.MemQs.ProdCountQs, "#SomeID#") == false) { APPLICATION.MemQs.ProdCountQs[SomeID] = structNew(); APPLICATION.MemQs.ProdCountQs[SomeID].ExpirationDate = now(); APPLICATION.MemQs.ProdCountQs[SomeID].ProdCount = 0; } If SomeID is not a variable then in that case you should surround SomeID in square braces with double quotes...

ColdFusion Dynamic Loop with jQuery Validation Plugin Creating Dynamic Rule

jquery,coldfusion,jquery-validate

I am using the jQuery Validation Plugin. I have a dynamic form that is created based on 1-5 depending on what number the user chooses for the loop. I am struggling on writing the dynamic portion to make each form field work correctly on each loop. What exactly are...

trying to find the value is numeric or integer from string

coldfusion

Seems like a good case for REGEX, but that's not my strength. If you are always looking for the value of the same item (construction), you could take advantage of the underlying Java and use the STRING.split() method. Then use the Coldfusion val() function to see what you get. The...

Coldfusion dynamic output of Bootstrap tabs

dynamic,coldfusion,tabs,bootstrap

The problem is here: <a href="###day##" aria-controls="##day#"... You have too many hashes after the first variable. Should be: <a href="###day#" aria-controls="#day#"... This should then output a functional link: <li role="presentation"><a href="#22" aria-controls="22"......

Coldfusion Link To Previous Page Remembers Text,Radio, and Dropdowns that were chosen

coldfusion

Radio What you need is: <input id="gender" name="gender" type="radio" value="Male" <cfif isDefined("form_gender") AND form_gender EQ "Male" >checked</cfif> />Male Note: You changed the value field in your example. But you don't want to do that: The value for the field labeled as "Male" should be "Male", and the value for the...

ColdFusion calling session function

session,coldfusion,cfc

In onSessionStart create the object and set it into the session. If you are using CF10+ you can use new() in CF9 and lower you need to use createObject(). <cffunction name="onSessionStart"> <!--- in CF10+ new calls init() automatically ---> <cfset session._user = new user()> <!--- CF9 or lower ---> <cfset...

Is it possible to use C++ CFX tags in Railo?

coldfusion,railo

Railo 4.2 is supposed to be compatible with CF 10 but it doesn't support C++ tags. It's intended to be compatible as far as cfml syntax goes but there are however a few things railo doesn't support, c++ cfx tags being one of them. It does support Java CFX tags....

How to skip unsupported image using cfimage processing?

coldfusion,coldfusion-10,cfml

Try using this function for reading images. CFimage tag or imageNew() can have issues while trying to read image files which are corrupted or files saved with changed extensions (background transparent .png files saved as .jpeg) while uploading. I think the main problem with these files is that there is...

ColdFusion Builder 3 vs. Dreamweaver & local and remote paths

eclipse,iis,coldfusion,development-environment

I really don't mind this question even though it's not directly code related because I've been using ColdFusion Builder (CFB) for years and there just isn't enough good documentation out there. I now enjoy a great experience with CFB thanks to blog posts and sharing experiences with other devs :)...

Bind failed: Item not found error in CF11

javascript,jquery,html,coldfusion

I was able to copy this locally. I moved the CFFORM outside the table tags, and it work. This was in FireFox and Chrome.

Can I specify a dynamic datasource at runtime?

coldfusion,coldfusion-11

You can create application-specific datasources at runtime in ColdFusion 11. See the docs: "Application-specific datasources in Application.cfc". I also discuss this in my blog: "Defining datasources in Application.cfc". An example would be: // Application.cfc component { this.name = "DSNTest02"; this.datasources = { scratch_mssql_app = { database = "scratch", host =...

How to get associative arrays notation to assign simple values

coldfusion,coldfusion-11

@Leigh is correct in that you need to supply the row number when using associative array notation with a query object. So you'd reference row 1 like: qryNWProducts[vcColName][1] As for your question Is this the best way to transfer the simple values from a query to a structure? Are you...

Exact string coldfusion regular expression

regex,coldfusion

You can do this <cfset data = ReReplaceNoCase("123NjyfjUghfLL|NULL|NULL|NULL","(^|\|)(?!NULL(?:$|\|))([^|]*)(?=$|\|)","\1","ALL")> (^|\|)(?!NULL(?:$|\|))([^|]*)(?=$|\|) Explanation: ( # Opens Capture Group 1 ^ # Anchors to the beginning to the string. | # Alternation (CG1) \| # Literal | ) # Closes CG1 (?! # Opens Negative Lookahead NULL # Literal NULL (?: # Opens Non-Capturing...

Confusion on when to use cfoutput in cfmail

coldfusion,cfoutput

You don't need it, unless perhaps you're doing looped output of a cfquery. e.g. if your emailformData query returned multiple rows (and it obviously doesn't), you might do: <cfmail ...> Here's the email data #form.name# asked for: <cfoutput query="emailformData"> #emailformData.Sold_to_Party# </cfoutput> Sent on #dateFormat(now())# </cfmail> See Sample uses of the...

If null statement in ColdFusion

coldfusion

You're evaluating the len(trim()) of the string "session.checkout.vehicle.makeCodeNumber" not the value of the variable session.checkout.vehicle.makeCodeNumber. You need to remove your " in your second if statement <cfif isDefined("session.checkout.vehicle.makeCodeNumber")> <cfif len(trim(session.checkout.vehicle.makeCodeNumber))> <cfpdfformparam name="make" value="#session.checkout.vehicle.makeCodeNumber#"> <cfelse> <cfpdfformparam name="make" value="#session.checkout.vehicle.vehiclemake#">...

IIS7 doesn't redirect to index in localhost

asp.net,iis,coldfusion

OK, I figured it out, by mistake there was an .cshtml copied in the wwwroot folder of my web server which caused this error. I deleted it and now all my sites are functioning correctly.

Using onMissingMethod cannot access object variables

coldfusion,coldfusion-10,railo

If I understand your issue, I'm surprised this code runs on Railo. I don't think it should. The issue is with this code: var func = variables.testObj[ arguments.missingMethodName ]; return func( argumentCollection = arguments.missingMethodArguments ); Here you are pulling the function getX() out of variables.testObj, and running it in the...

Passing Coldfusion Form Values to javascript and CFC , code not working

javascript,jquery,ajax,coldfusion

I was able to resolve the issue which had to do with resolving the path to the cfc. Working code is below. Solution: AJAX: <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script> <script language="javascript"> $(document).ready(function() { $("#createReport").click(function(f) { var getReportName = $("input#reportName").val(); var getReportPath = $("input#reportPath").val(); var getReportDesc = $("input#reportDescrip").val(); //var getCategory = $("input#categoryBox").val(); $.ajax({...

How to sanitize form values to allow text-only

coldfusion,sanitization,coldfusion-11,antisamy

While you could use AntiSamy to do it, I don't know how sensible that would be. Kinda defeats the purpose of it's flexibility, I think. I'd be curious about the overhead, even if minimal, to running that as a filter over just a regex. Personally I'd probably opt for the...

(Coldfusion) Prevent submit button from being exported to excel with table data

coldfusion,submit,export-to-excel

You need to just put your form in an if statement like this: <cfif NOT (structKeyExists(form, "nav") AND form.nav EQ "export")> <form> ................. ................. </form> </cfif> The above code will ensure that the form (and hence any form elements) is not available when user chooses to export the table to...

how to display other information after hitting the button?

html,coldfusion

Okay, maybe this will help you. You're trying to use a plain button to submit the form. <input type="button" name="kalturaBtn" value="upload to kaltura" href="javascript:void();" onclick="popupwindow('https://lampa.human.cornell.edu/csg.kaltura/test.php?kurl=#myurl#&kname=#form.title#&rec=#ddl_choice#','','1200', '700'); return false;">` Instead, you need to use a submit button. The other thing causing a problem for you is that after the popupwindow() script,...

SessionTimeout not overrriding CF Administrator

coldfusion

Per the ColdFusion documentation: " you cannot set a time-out value [in Application.cfc or Application.cfm] that is greater than the maximum session time-out value set on the Administrator Memory Variables page." Since you are on shared hosting, if your host won't increase the timeout (and they probably won't), you're going...

How to find occurrences of a specific string within an unordered list in ColdFusion?

regex,coldfusion

You should use negation of the terms you want to enclosure your match instead of .*. You can do this: <li>[^>]*bumblebee[^<]*</li> Here is Demo...

SQL Syntax Error submitting query with coldfusion

sql-server,coldfusion

It looks like you have named your table using a SQL reserved word; Transaction. I would not recommend that as you may run into issues (like you have now). However, it can be done. Try this and see if it works: INSERT INTO [dbo].[Transaction] (Type, OwnerType) VALUES ( <cfqueryparam value='NonLeased'...

Dynamic bootstrap active tab

coldfusion,bootstrap,tabpanel

You can give this a try: <div role="tabpanel"> <!-- Nav tabs --> <ul class="nav nav-tabs" role="tablist"> <cfoutput query="lessons" group="lesson_date"> <li role="presentation" <cfif lessons.currentRow EQ 1>class="active"</cfif>> <a href="###DateFormat(lesson_date, 'ddddd')#" aria-controls="#DateFormat(lesson_date, 'ddddd')#" role="tab" data-toggle="tab" >#DateFormat(lesson_date, 'ddddd')#, #DateFormat(lesson_date, 'd')# #DateFormat(lesson_date, 'mmmm')# </a> </li>...