coldfusion

How to remove text after certain word

那年仲夏 提交于 2020-01-30 08:15:06
问题 I have a string The best laid schemes of mice and men How do I remove all text after the word "schemes" in ColdFusion? I suppose this can be done with regex. 回答1: Here ya go: <cfset myString = "The best laid schemes of mice and men" /> <cfoutput>#REReplace(myString, "schemes(.*)", "schemes")#</cfoutput> 回答2: Your regex is: schemes.*$ and replace with "schemes" Explanation .*$ means match any character ( . ) 0 or more times ( * ) till the end of the row ( $ ) 回答3: Try this regex: schemes(.*)

Coldfusion Component Pointers

孤街浪徒 提交于 2020-01-28 11:18:32
问题 I'm having an issue with a Coldfusion component that I'm building. Well, I'm not really sure if it's a problem or how things are supposed work, but it seems strange. First, I set up arguments for the init function of my component and invoke the component. But if I change one of the arguments after I invoke, it also changes the values held in the component. Is this correct? I'm not sure if I'm explaining this very well. Here's some pseudo-code: <cfset fruit = [] /> <cfset fruit[1] = { id = 1,

SerializeJSON doesn't encode UTF8 characters in ColdFusion 9

我的梦境 提交于 2020-01-28 10:39:23
问题 I'm having some issues with ColdFusion and JSON. My users have filenames and other key words with characters like ç in them which is causing me a pain when I have to pass them back via JSON. When I use the magic JSON command on my variable: <cfcontent type="application/json"> <cfset variables.stGalleryItem = StructNew() /> <cfset variables.stGalleryItem["imagePath"] = siteRoot & '/images/350460/hellç.txt' /> <cfset variables.stGalleryItem["title"] = 'çççç' /> <cfset variables.stGalleryItem[

Getting directory listing from SVN for use in ANT dropdown

为君一笑 提交于 2020-01-28 10:01:28
问题 I've done some Googling on this but I can't seem to find anything along the lines of what I'm needing. I'm using ANTForms for the GUI on our deployment. Developers can choose the build from the dynamically populated dropdown , hit ok and away it goes. The way the dropdown is dynamically populated at the moment is by ANT making an HTTP webservice call to our ColdFusion server giving it a list of needed SVN directories. CF then uses a bit of underlining Java to call SVNKit and return a query

disable submit button after form submit and save the disable state of the button

烂漫一生 提交于 2020-01-26 03:47:05
问题 I have a page which has a form with questions and answers, upon submit I want to disable to button, and the user is taken to a thanks page. From that page when the user hits back button on browser he comes back to the form page(ques and ans page), at that point since he has already submitted the form i want the button to remain disabled to prevent from retaking the ques. I have the below code, but it is not serving the purpose sometimes its only working in FF and not in chrome. (upon going

Form Variables are not showing up after form submit. ColdFusion

∥☆過路亽.° 提交于 2020-01-26 03:27:23
问题 <form name="abc" id="abc" method="post" action="/test.cfm" enctype="multipart/form-data"> <input type="submit" name="btnSubmit" id="btnSubmit" value="OK" /> </form> for some reason when I hit submit the "btnSubmit" is not showing up in the cfdump. <cfdump var="#form#"> 回答1: There aren't a lot of things that could cause it to simply not appear in your form. My short-list of culprits are: Looking at the wrong file / server. The page is being redirected via cflocation or otherwise (javascript

Set Bar color according to data in CF chart

匆匆过客 提交于 2020-01-25 18:12:16
问题 I am creating a bar graph in CF11 .Is it possible to give different colors for the different bars in CFchartseries according to the data. <cfchartseries serieslabel="Rent" type="bar" colorlist="barcolr_list"> <cfloop index="counter" from=1 to="#ArrayLen(PropName_arry)-1#" step="1"> <cfchartdata item="#PropName_arry[counter]#" value="#Grossrent_arry[counter]#" > </cfloop> </cfchartseries> I read in docs that the colorlist attribute is available for pie,pyramid..etc graph . How can i set

Set Bar color according to data in CF chart

十年热恋 提交于 2020-01-25 18:09:52
问题 I am creating a bar graph in CF11 .Is it possible to give different colors for the different bars in CFchartseries according to the data. <cfchartseries serieslabel="Rent" type="bar" colorlist="barcolr_list"> <cfloop index="counter" from=1 to="#ArrayLen(PropName_arry)-1#" step="1"> <cfchartdata item="#PropName_arry[counter]#" value="#Grossrent_arry[counter]#" > </cfloop> </cfchartseries> I read in docs that the colorlist attribute is available for pie,pyramid..etc graph . How can i set

Keeping the values of form on page

帅比萌擦擦* 提交于 2020-01-25 00:12:22
问题 I want to keep the values chosen by the user on the form once they submit the form. This is what I tried: <cfset tx_name = ""> <cfset id_age1 = ""> <cfif isDefined("form.tx_name")> <cfset tx_name = form.tx_name> <cfif isDefined("a1")> <cfset id_age1 = form.a1> </cfif> </cfif> <cfoutput> <input type="text" name="tx_name" value="#tx_name#"> <select name="id_age1"> <cfloop from="1" to="20" index="a1"> <option value="#a1#">#a1#</option> </cfloop> </select> </cfoutput> I am getting the expected

Keeping the values of form on page

*爱你&永不变心* 提交于 2020-01-25 00:12:15
问题 I want to keep the values chosen by the user on the form once they submit the form. This is what I tried: <cfset tx_name = ""> <cfset id_age1 = ""> <cfif isDefined("form.tx_name")> <cfset tx_name = form.tx_name> <cfif isDefined("a1")> <cfset id_age1 = form.a1> </cfif> </cfif> <cfoutput> <input type="text" name="tx_name" value="#tx_name#"> <select name="id_age1"> <cfloop from="1" to="20" index="a1"> <option value="#a1#">#a1#</option> </cfloop> </select> </cfoutput> I am getting the expected