coldfusion

How to efficiently test and parse a deep value in XML?

允我心安 提交于 2019-12-13 02:23:18
问题 I am using ColdFusion 8. I am parsing an XML document and need to get at a single value that is buried deep in the document. I am successfully parsing the document and getting the values I need, but it seems that there has to be a more efficient means to get to the same data. I have NOT parsed much XML. Is having to test for the existence of keys this deep very typical in parsing XML or am I doing something wrong? Is there a better way to code this? // PARSE THE SOAP RESPONSE SoapResponse =

How can I sanitize user input but keep the content of <pre> tags?

ε祈祈猫儿з 提交于 2019-12-13 02:18:56
问题 I'm using CKEditor in Markdown format to submit user created content. I would like to sanitize this content from malicious tags, but I would like to keep the formatting that is the result of the markdown parser. I've used two methods that do not work. Method one <!--- Sanitize post content ---> <cfset this.text = HTMLEditFormat(this.text)> <!--- Apply mark down parser ---> <cfx_markdown textIn="#this.text#" variable="parsedNewBody"> Problem For some reason <pre> and <blockquote> are being

Coldfusion SpreadsheetAddRow() - How to get around values with commas

这一生的挚爱 提交于 2019-12-13 02:11:31
问题 I've read some of the other solutions to this problem on the web, but none of the help in my particular situation. I'm looping over a query and using spreadsheetAddRow() to add rows to my Excel spreadsheet with each iteration. The problem is that any value with a comma in it causes CF to throw a "String index out of range: -1" error. This happens even though I'm wrapping these values in single quotes. So something like: <cfset spreadsheetAddRow(s, "'foobar','foo,bar'")> The first value is

CFDocument PDF rendering issue with japanese

半世苍凉 提交于 2019-12-13 01:53:42
问题 Having some issue with Japanese font in cfdocument . The fonts are correctly coming up but they are being stretched (word wraps not working) and taking up extra space and hence breaking the design in the pdf file. The HTML content used in cfdocument is rendering correctly, also same is working correctly for Chinese and Korean fonts in the PDF file as well. Let me know if any more details are needed. 回答1: The word wrap issue was fixed by adding ColdFusion wrap function. 来源: https:/

CfChart Stacked bars and unstacked Lines

百般思念 提交于 2019-12-13 01:51:42
问题 I am trying to create a CFChart with Stacked Bars and unstacked Lines. Have been trying to work around in the Webcharts Tool but no luck so far. In the example image all the series are seriesplacement=stacked , but I want to have the bars(Avg and TDD) as stacked and the lines (Max and Min) as seriesplacement=default . Is there a way to achieve the same in Cfchart? 回答1: If I am understanding correctly, just set the placement of the line series in your xml style: <?xml version="1.0" encoding=

sorting array by custom order in Coldfusion

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-13 01:32:26
问题 Ive got an array of product sizes which can be varied. some cases it will be. 08 10 12 16 18 S M L XL XXL I appear to be able to sort the array of numeric values easily, however when the sizing has strings with it also, i cant seem to sort them in alphabetical order as well Example it ends up being L M S XL XXL technicailly speaking, this is correct for alphabetical order, but the order for it for human beings should be S M L XL XXL Would anyone know of a way to do this using Coldfusion ? Im

return variable undefined in jQuery $.post sent by a cfc

家住魔仙堡 提交于 2019-12-13 01:20:44
问题 I am using $.post() to send a json to my cfc, which updates some records. I am not returning a json back to the calling page, I am just returning the contents of a variable that I am setting in the cfc. Based on the value of that variable, the update was/was not successful. I cannot seem to get at the contents of the variable. I just started using jQuery, so I think I'm doing it right, but apparently not. the jQuery: $("#edit_button").click(function(){ if(theArray.length > 0){ theJson = JSON

how do I trim an email input address so only the data before the @ is inputted into the database?

蓝咒 提交于 2019-12-13 01:13:39
问题 I am using coldfusion 9 to add data into a MySQL database from a form. I would like to create a username from the email address inputed into the form. for example, <cfset store_user_email = EMAILADDRESS> <cfset store_username = trim EMAILADDRESS before the @> I'm not sure how to trim down the email address? Any help would be much appreciated. 回答1: <cfset store_username = trim(listFirst(EMAILADDRESS,"@"))> 来源: https://stackoverflow.com/questions/6775360/how-do-i-trim-an-email-input-address-so

How to correctly insert time and date into a table?

泄露秘密 提交于 2019-12-13 00:44:07
问题 I't tyring to insert a time AND date into a table using a form. <tr> <td> Date (Please enter date format mm/dd/yyyy.):</td> <td><INPUT TYPE="text" NAME="date_used" SIZE="10" VALIDATE="date"></td> </tr> <tr> <td> Time (Please enter time format hh:mm tt):</td> <td><INPUT TYPE="text" NAME="time_used" SIZE="10" VALIDATE="time" ></td> </tr> ..... <CFSET date_used = #DateFormat(CREATEODBCDATETIME(date_used), "mm/d/yyyy")#> <CFSET time_used = #DATEFormat(CREATEODBCTIME(time_used),"h:mm tt")#> But

Coldfusion/MAMP Pro/Windows 10

核能气质少年 提交于 2019-12-13 00:14:18
问题 Documentation on setting up Mamp to work with Coldfusion in a Windows environment seems to be pretty limited, so here I am. I have both MAMP PRO and COLDFUSION 11 set up on a WINDOWS 10 computer. Mamp is pointed to the correct Document Root folder and both Apache and MySQL services start correctly (I assume). When I navigate to 'localhost' in my browser, all I can see is the ColdFusion source - not a rendered page. I assume ColdFusion isn't running in this instance. The .htaccess file seems