Posts
Showing posts from 2013
How to parse JSON in coldfusion
- Get link
- X
- Other Apps
Parses the json object and displays the contents of its arrays using DeserializeJSON, This function is useful any time a ColdFusion page receives data as JSON strings. I Type Json: <cfoutput> <cfset JsonData='[{"reason": "email address is unknown", "email": "abc@hotmail.comh"}, {"reason": "email address is unknown", "email": "bbc@68gmail.com"}, {"reason": "email address is unknown", "email": "ff@ff.com"}, {"reason": "Known bad domain", "email": "rr@hotmai.com"}, {"reason": "email address is unknown", "email": "ll@pp.rr.com"}]'> <cfset JsonData=REReplace(JsonData,"^\s*[[:word:]]*\s*\(\s*","")> <cfset JsonData=REReplace(JsonData, "\s*\)\s*$", "")> <cfset cfData=DeserializeJ...
Insert multiple rows at a time in database
- Get link
- X
- Other Apps
We can insert multiple rows in data using one query.It reduce the number of times execute requests. I Type : <Cfquery name="InsertReportDetails" datasource="TestDB"> INSERT INTO UserReporting(UserId,BatchId, ReportId) SELECT #session.UserID#,2,1 UNION SELECT #session.UserID#,2,2 UNION SELECT #session.UserID#,2,3 UNION SELECT #session.UserID#,2,4 </Cfquery> II Type : <Cfquery name="InsertReportDetails" datasource="TestDB"> INSERT INTO UserReporting(UserId,BatchId, ReportId) VALUES (#session.UserI...
Connect to database in php using class with constructor
- Get link
- X
- Other Apps
array with struct in coldfusion
- Get link
- X
- Other Apps
array with struct - Create Json using array with struct in coldfusion <cfquery name="GetUsers" datasource="TestDB"> SELECT UserID, UserName,Active, CASE Active WHEN 1 THEN 'Active' WHEN 0 THEN 'InActive' END AS Status FROM shema_users </cfquery> <cfset resultStruct = Structnew() /> <cfset JsonArray = ArrayNew(1) /> <cfset Counter=1> <cfloop query="GetUsers"> <CFSET color = FormatBaseN(RandRange(0,255), 16) & FormatBaseN(RandRange(0,255), 16) & FormatBaseN(RandRange(0,255), 16)> <cfset JsonArray[Counter] = Structnew() /> <cfset JsonArray[Counter]["UserID"] = "#UserID#" /> <cfset JsonArray[Counter]["UserName"] = "#UserName#" /> <cfset JsonArray[Counter]["Active"] ...
Create CSV file in Coldfusion Using CFFile
- Get link
- X
- Other Apps
Create CSV file in Coldfusion Using CFFile <cfquery name="GetUsers" datasource="TestDB"> SELECT UserID, UserName, Password,Active, CASE Active WHEN 1 THEN 'Active' WHEN 0 THEN 'InActive' END AS Status FROM shema_users </cfquery> <cfset HeaderColumn = "UserID,UserName,Password,Status"> <CFSET FileOutputPath = "C:\ColdFusion10\cfusion\wwwroot\Test\uploads"> <CFFILE ACTION="Write" FILE="#FileOutputPath#\Users.csv" OUTPUT="#HeaderColumn#" nameconflict="overwrite" addnewline="yes"> <cfloop query=...
Using traversal or filtering examples on list in jquery
- Get link
- X
- Other Apps
Using traversal or filtering examples on list in jquery <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <!---I Type HTML Code---> <div id="vacations-wrapper"> <h1>Demo Html Code 1</h1> <ul id="vacations"> <li class="vacation america"> <h2>AA</h2> <span class="details">$100</span> </li> <li class="vacation america"> <h2>BB</h2> <span class="details">$200</span> </li> <li class="vacation europe"> <h2>CC</h2> <span class="details">$400</span> </li> <li class="vac...
Display hours in select box with am/pm using php
- Get link
- X
- Other Apps
Display hours in select box with am/pm using php Select Hour :- <select name="starthour" style="padding:5px;"> <?php date_default_timezone_set('Asia/Kolkata'); $currentDateTime=date('m/d/Y H:i:s'); $curtime = date('H', strtotime($currentDateTime)); $starttime = 00; $endtime = 23; $endloop = ($starttime + $endtime); for($hour = $starttime; $hour <= $endloop ; $hour ++ ) { $showtime = $hour.':00:00'; ?> <option value="<?php echo $hour; ?>" <?php if($curtime == $hour) echo "selected='selected'" ?>><?php echo date('h A', strtotime($showtime)); ?></opt...
Display hours in select box with am/pm using coldfusion
- Get link
- X
- Other Apps
Display hours in select box with am/pm using coldfusion. Select Hour :- <select name="starthour" style="padding:5px;"> <cfset curtime = TimeFormat(Now(),'HH')> <cfset starttime = 00> <cfset endtime = 23> <cfset endloop = (starttime + endtime)> <cfloop from="#starttime#" to="#endloop#" index="hour"> <cfset showtime = hour & ':00:00'> <option value="#hour#"<cfif curtime eq hour> selected="selected"</cfif>>#TimeFormat((showtime),'hh tt')#</option> </cfloop> </select> </cfoutput>
Create excel,Create CSV,pdf,xml file,Validate Email and Phone using Regex in coldfusion
- Get link
- X
- Other Apps
Some tiny works in coldfusion for new programmers like create excel, pdf, and use of cfsavecontent,make first letter capital,Validate EmailID and Phone using regex etc. <cfoutput> <!---Start : Make first letter capital of a name---> <cfset UserName = "pintu"> #rereplace(UserName, '^(\w)(.*)', '\u\1\2')# <!---End : Make first letter capital of a name---> <!---Start: Create Excel File---> <cfsetting enablecfoutputonly="Yes"> <cfcontent type="application/msexcel"> <cfheader name="Content-Disposition" value="filename=FileName.xls"> <!---Excel File Content---> <table border="0"> <tr><td>Name</td><td>Marks</td...
Populating a second select box depending of the first select box option in coldfusion
- Get link
- X
- Other Apps
Delete multiple records using checkboxes in Coldfusion
- Get link
- X
- Other Apps

This is the example to delete, active and inactive multiple rows from mysql using javascript and Coldfusion. We can checked all checkboxes and validate if no any checkbox checked. ---------------------------------------------------------------------------------------------------------- If you like this or this is useful for you. Please comment us. Thank You
Delete multiple rows using checkboxs in PHP
- Get link
- X
- Other Apps
Last month i am working, how to delete multiple rows from mysql using php and also active or inactive multiple selected rows. This is good one example to delete, active and inactive multiple rows in mysql using javascript and php. Preview Heritages.php If you like this or this is useful for you. Please comment us. Thank You
Change value of second select box according first select box.
- Get link
- X
- Other Apps
Upload multiple file using jquery and Coldfusion
- Get link
- X
- Other Apps
Sorry, But i did not do something new for upload multiple files.I modified the files according to coldfusion requirement. It may be better but currently i have not enough time for experiments for these files. I will do better in future using these files.... but until use these files. If you have any solutions for making better please give me suggestions. Download jquery files form http://blueimp.github.com/jQuery-File-Upload/ uploadedfiles.cfm Output :- uploadfiles.cfm Output: upload.cfm : After click on Addfiles.. Select all files with ctr+a with firefox..... Click Start Upload and after on finish... Congratulation files uploaded. I hope this is useful for upload multiple files with coldfusion using jquery file upload.
Change sequence no of multiple options field values using Javascript and mysql using coldfusion
- Get link
- X
- Other Apps
Create Image Thumbnail in Coldfusion without losing dimension ratio.
- Get link
- X
- Other Apps
Login with facebook using coldfusion
- Get link
- X
- Other Apps
Here is a example. How to make facebooklogin for a website using coldfusion?. Before start you make a account with facebook. Step 1 : Create a app for your website using facebooklogin.here you can get app_key and secret_key. Step 2: Step 4: You can see this screen : Step 5: After filling UserName and Password a screen show like this... After click ok the redirect to logininformation:- Output in logininformation.cfm I hope this is useful for you. if you are facing any problem write us in comment. we are happy to solve that problem. For more details visit these links : - http://developers.facebook.com/docs/facebook-login/ //Permissions http://developers.facebook.com/docs/reference/login/ https://developers.facebook.com/docs/reference/api/user/
Creating SOAP example using coldfusion
- Get link
- X
- Other Apps

Many coldfusion programmer faces a problem to connect SOAP with CFC. Here a example to fix the problem that explain how to connect SOAP with CFC?. ----callcfc.cfc---- <cfcomponent output="false" > <cffunction name="getelement" access="remote" returntype="any" output="false"> <cfargument name="name" type="string" required="false"/> <cfargument name="firstNumber" type="numeric" required="false"/> <cfargument name="secondNumber"type="numeric" required="false"/> <cfreturn arguments.name & " Have " & arguments.firstNumber + arguments.secondNumber & " Point "> </cffunction> </cfcomponent> -----Index.cfm <cfsavecontent variable="soap"><?xml version="1.0" encoding="UTF-8"?> ...
Post data by ajax using coldfusion component
- Get link
- X
- Other Apps
In this example, we are using AJAX to handle the form submission with form validations, That's insert data into database table. Output : - On click Submit button: That form post the values on update.cfc file. On Successfully Submit data Screen : I hope this is useful for new coldfusion programmers. Thank You