Posts

Showing posts with the label Coldfusion

Get Random Record From List In Coldfusion

<cfset ColorList="#999999,#FF0F00,#FF6600,#FF9E01, #FCD202,#F8FF01,#B0DE09,#04D215,#0D8ECF,#0D52D1, #2A0CD0,#8A0CCF,#CD0D74,#754DEB,#DDDDDD,#333333">   <cfset randIndex = RandRange(1,listlen(ColorList))> <cfoutput> #ListGetAt(ColorList,randIndex,',')# </cfoutput>

ISO 8601 datetime String format in coldfusion

Convert datetime format into iso datetime format using coldfusion dateconvert, dateformat and timeformat <cfset date = now() /> <cfset datetime = dateConvert( "local2utc", date )> <cfoutput> #dateFormat( datetime, "yyyy-mm-dd" ) & "T"  & timeFormat( datetime, "HH:mm:ss" ) & "Z"# </cfoutput> Output: 2015-06-09T14:22:59Z

Bootstrap Table Server Side With Coldfusion

Bootstrap Table Server Side With Coldfusion Component. Bootstrap Table is licensed under the The MIT License. <!DOCTYPE html> <html lang="en">   <head>         <meta charset="utf-8">         <meta http-equiv="X-UA-Compatible" content="IE=edge">         <meta name="viewport" content="width=device-width, initial-scale=1">         <meta name="description" content="">         <meta name="author" content="">         <title>Meessage Broadcast Admin</title>         <!-- Bootstrap core CSS -->         <link href="../public/css/bootstrap.min.css" rel="stylesheet">         <link href="../public/...

Autocomplete Textbox Jquery with Database Coldfusion

Autocomplete Textbox Jquery with Database Coldfusion using cfcomponent, coldfusion, StructNew ,cffunction, ArrayAppend, mysql, cfqueryparam, Jquery, Jquery Autocomplete < link rel = " stylesheet " href = " jquery-ui.css " /> < script src = " jquery-1.9.1.js " > </ script > < script src = " jquery-ui.js " > </ script > < cfform name = " actoComp " > < table border = " 0 " cellpadding = " 0 " cellspacing = " 10 " > < tr > < td > Account No < br > < cfinput type = " text " name = " accountNo " id = " accountNo " > </ td > < td >   < input type = " submit " name = " Submit " value = " SUBMIT " >   </ td > </ tr > </ table > </ cfform > <...

Create text on image in center using coldfusion imageDrawText

Using imageSetDrawingColor, imageDrawText, imageNew, writeToBrowser, coldfusion, structNew, Create text image in image center. <cfset text = "P"> <cfset imageWidth = 100 /> <cfset imageHeight = 100 /> <cfset txtWidth = 30 /> <cfset txtHeight = txtWidth /> <cfset textImg = imageNew("",imageWidth,imageHeight,"rgb","red")> <cfset x=max(textImg.width,textImg.height)> <cfset newheight=textImg.height*txtHeight/x> <cfset newwidth=textImg.width*txtWidth/x> <cfset newx = (textImg.width/2 - newwidth/2)> <cfset newy = (textImg.height/2 + newheight/2)> <cfset texAttr = StructNew()> <cfset texAttr.font="Arial"> <cfset texAttr.size = txtWidth> <cfset texAttr.style = "bolditalic">   ............ ............ ............   More details Visit - https://www.elearn99.com/programming/create-text-image-center-imagedrawtext/253/  

Select Multiple Files in The Browser And Upload All

Implement an HTML5 input field that select multiple files to upload using with coldfusion uploadall file action. < form name = " imageForm " action = " new.cfm " method = " post "   enctype = " multipart/form-data " > < input type = " file " name = " image " multiple = " multiple "   accept = " image/jpeg, image/gif, image/png, application/zip " />   < br /> < input type = " submit " name = " submit " value = " Submit " /> </ form > More Details Visit-> https://www.elearn99.com/programming/upload-multiple-files-coldfusion/260/

Write and read txt file and insert into database with coldfusion

Write and read txt file and insert into database with coldfusion, mysql and SQL Server <cfoutput>     <cfset HTTPUploadPath = "C:\ColdFusion10\cfusion\wwwroot\pintu\uploads\">     <cfset inpFileName = "test.txt">     <!---******** Start: text File Write Session ***************--->         <cfparam name="fileExists" default="Yes">     <!--- Get unique file name --->     <cfset FileCounter = 0>     <cfloop condition='fileExists eq "yes"'>         <cfif FileExists("#HTTPUploadPath##inpFileName#") is "Yes">             <cfset FileCounter = FileCounter + 1>             <cfset fileExists="yes">             <cfset inpFileName = "test#FileCounte...

Add and remove textbox dynamically using coldfusion and jquery

Image

Load div content on scroll using coldfusion

Scroll.cfm <cfsetting showdebugoutput="no"> <style> .loading{         display: block;         margin: 0px auto;         text-align: center;     } </style> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <script> $(document).ready(function() {     var loading = false;     //initial track_load     var track_load = 1;     //a place for my crap     var loadContentDiv = $("#content");     //populate the initial content     loadContent(track_load);         $(window).scroll(function() { //detect page scroll                        if($(window).scrollTop() + $(window).height() == $(...

Upload file on select browse file event

Image
This is the example to show browse button on image on mouse over and remove then on mouse leave using css and javascript and upload file on select browse file event using Coldfusion,CSS and Jquery. After mouse over shows browse image button.

Query Alteration with Coldfusion using Query of Queries (QoQ)

Image
Using alteration in ColdFusion query we can be altered without effecting the identification of a cached query with QOQ. Original Query Output. After Alteration Query Output.

Create excel file using Cfspreadsheet

How to parse JSON in coldfusion

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

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...

array with struct in coldfusion

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"] ...

Post data with getJson in coldfusion

Image
Use of getJson using coldfusion component and QueryNew. OutPut :- After Submit :-

Create CSV file in Coldfusion Using CFFile

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=...

Display hours in select box with am/pm using coldfusion

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>

Auto fill textbox using jquery in Coldfusion

Auto fill textbox using jquery in Coldfusion . Y ou allow the user to type in a value into a Textbox and fetch values from database according that keyword.

Populating a second select box depending of the first select box option in coldfusion

Populating a second select box depending of the first select box option  binding with coldfusion component