Skip to main content

Posts

Showing posts with the label better

CFMAP - Generate an earth type google map in ColdFusion

CFmap - earth type Google map cfmaptypeearth.cfm <!DOCTYPE html"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>cfmap tag - how to generate earth type google map in coldfusion</title> </head> <body style="margin:5px 5px 5px 15px;"> <h2 style="color:IndianRed; font-style:italic"> cfmap tag - how to generate earth <br /> type google map in coldfusion </h2> <hr width="525" align="left" color="Pink" /> <br /> <!--- Generate a Google map api key for this domain http://localhost:8500/ ---------------- Use your own google map api key to test this example ---> <cfajaximport params="#{googlemapkey='please use your own google map api key here'}#"> <cfmap centeraddress="Nebraska" heigh...

CFMAP - How to change google map marker color in ColdFusion

CFmap - Marker color in Google map cfmapmarkercolor.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>cfmap tag - how to change marker color in google map in coldfusion</title> </head> <body style="margin:5px 5px 5px 15px;"> <h2 style="color:DarkBlue; font-style:italic"> cfmap tag - how to change marker color <br /> in google map in coldfusion </h2> <hr width="525" align="left" color="DarkBlue" /> <br /> <!--- Generate a Google map api key for this domain http://localhost:8500/ ---------------- Use your own google map api key to test this example ---> <cfajaximport params="#{googlemapkey='please use your own google map api key here'}#"> <table> <tr> <td> ...

CFAJAXIMPORT to specify Google map API Key in ColdFusion

CFajaximport - params attribute to specify Google map API Key cfajaximportparams.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>How to use cfajaximport params attribute to specify Google map API Key in coldfusion</title> </head> <body style="margin:5px 5px 5px 15px;"> <h2 style="color:DarkBlue; font-style:italic"> How to use cfajaximport params attribute <br /> to specify Google map API Key in coldfusion </h2> <hr width="400" align="left" color="PowderBlue" /> <br /> <!--- Generate a Google map api key for this domain http://localhost:8500/ ---------------- Use your own google map api key to test this example ---> <cfajaximport params="#{googlemapkey='please use your own Google map API Key here...

How to use cfsqltype in cfqueryparam tag in ColdFusion

CFqueryparam and CFsqltype Usingcfsqltype.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>cfqueryparam and cfsqltype - how to use cfsqltype in cfqueryparam tag</title> </head> <body> <h2 style="color:DarkBlue; font-style:italic">ColdFusion cfqueryparam tag example: how to use cfsqltype</h2> <hr width="600" align="left" color="PowderBlue" /> <br /> <cfparam name="url.EmpID" default="0"> <cfquery name="qEmploees" datasource="cfdocexamples"> select Emp_ID, FirstName, LastName from Employee where Emp_ID = <cfqueryparam value="#url.EmpID#" cfsqltype="cf_sql_integer"> </cfquery> <div style=" font-family:'Lucida Sans Unicode', 'Lu...

How to use NEQ operator in cfif condition in ColdFusion

CFif NEQ operator cfifNEQOperator.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>cfif NEQ operator - how to use (NEQ) operator in cfif condition</title> <style type="text/css"> .divCSS { background-color:Crimson; color:White; font-family:"Trebuchet MS", Arial, Helvetica, sans-serif; font-size:large; width:400px; height:60px; text-align:center; padding-top:10px; border:thick; border-style:dotted; } </style> </head> <body> <h2 style="color:SeaGreen; font-style:italic">coldfusion cfif tag example: how to use "NEQ" operator</h2> <hr width="575" align="left" color="LawnGreen" /> <br /> <cfset UserRole="Guest"> <div class="divCSS...

ColdFusion - How to use IS NOT operator in cfif conditional processing

CFif IS NOT operator cfifISNOTOperator.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>cfif IS NOT operator - how to use (IS NOT) operator in cfif conditional processing</title> <style type="text/css"> .divCSS { background-color:DeepPink; color:Snow; font-family:"Courier New", Courier, monospace; font-size:large; width:450px; height:75px; text-align:center; padding-top:25px; } </style> </head> <body> <h2 style="color:SeaGreen; font-style:italic">coldfusion cfif tag example: how to use "IS NOT" operator</h2> <hr width="550" align="left" color="DarkSeaGreen" /> <br /> <cfset PreferedColor="DodgerBlue"> <div class="divCSS"> ...

How to get coldfusion DataSource list programmatically

Get ColdFusion DataSource list programmatically GetDataSourceList.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>DataSource List - how to get coldfusion DataSource list programmatically</title> </head> <body> <h2 style="color:Crimson; font-style:italic">DataSource example: how to get DataSource list</h2> <hr width="500" align="left" color="LightPink" /> <br /> <cfobject action="create" type="java" class="coldfusion.server.ServiceFactory" name="cfactory" > <cfset DSourceStruct=cfactory.getDataSourceService().getDataSources()> <cfset DSourceList=StructKeyList(DSourceStruct,",")> <table border="1" cellpadding="2" cellspacing=...

How to dump and get output server variables in coldfusion

Server variables serverVariables.cfm <!DOCTYPE html"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>server variables - how to dump and get output server variables</title> </head> <body> <h2 style="color:DodgerBlue; font-style:italic">coldfusion server variables example: how to get output</h2> <hr width="500" align="left" color="PowderBlue" /> <br /> <cfdump var="#server#"> <br /> <font style="font-weight:bold; color:SeaGreen; font-size:large;">example server variable Output</font> <br /> <font style="color:DeepPink; font-weight:bold; font-family:'Courier New', Courier, monospace;"> PRODUCT VERSION[#server.ColdFusion.PRODUCTVERSION#]: <cfoutput>#server.ColdFusio...

CFhttp - Using delimiter when reading a CSV file in ColdFusion

cfhttp - delimiter attribute employee.csv Emp_ID; FirstName; LastName 1; Jenny; Jones 2; Anne; Patel 3; Sonia; Akter cfhttpDelimiter.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>cfhttp: how to use delimiter attribute when read a csv file in coldfusion</title> </head> <body> <h2 style="color:DeepPink; font-style:italic">cfhttp tag example: how to use delimiter attribute</h2> <hr width="500" align="left" color="OrangeRed" /> <br /> <cfhttp method="get" url="http://localhost:8500/cfexample/employee.csv" name="EmployeeData" delimiter=";" > </cfhttp> <table border="1" cellpadding="5" cellspacing="0" bordercolor="Crimson">...

How to disable date range of a Calendar in ColdFusion

cfcalendar - disable date range cfcalendarStartRangeEndRange.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>cfcalendar tag: how to disable date range (startRange, endrange) in calendar in coldfusion</title> </head> <body> <h2 style="color:OliveDrab; font-style:italic">cfcalendar tag example: how to use startrange, endrange attribute</h2> <hr width="625" align="left" color="Olive" /> <br /> <cfif IsDefined("Form.SubmitClassDate")> <cfoutput> <h3 style="color:DarkSeaGreen;"> Next Class Date Is: #DateFormat(Form.ClassDate)# </h3> </cfoutput> </cfif> <cfform name="CalendarStartRangeEndRangeTest" method="post" format="html"> <table bo...

How to change Calendar selected date in ColdFusion

cfcalendar - set change selected date cfcalendarSelectedDate.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>cfcalendar tag: how to set change selected date in calendar in coldfusion</title> </head> <body> <h2 style="color:Crimson; font-style:italic">cfcalendar tag example: how to use selecteddate attribute</h2> <hr width="575" align="left" color="Crimson" /> <br /> <cfif IsDefined("Form.SubmitConferenceDate")> <cfoutput> <h3 style="color:SaddleBrown;"> Next Conference Date Is: #DateFormat(Form.ConferenceDate)# </h3> </cfoutput> </cfif> <cfform name="CalendarSelectedDateTest" method="post" format="html"> <table border="1...

How to use arguments scope as an array in ColdFusion

cfargument - arguments scope as an array cfargumentScopeAsArray.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>cfargument tag: how to use the arguments scope as an array in coldfusion</title> </head> <body> <h2 style="color:DodgerBlue; font-style:italic">cfargument tag example: using the arguments scope as an array</h2> <hr width="600" align="left" color="OrangeRed" /> <br /> <cffunction name="GetCenter" access="remote" returntype="query"> <cfargument name="Center_ID" type="numeric"> <cfquery name="qCenter" datasource="cfdocexamples"> SELECT Center_ID, Name, Address1 FROM CENTERS WHERE Center_ID= #arguments[1]# </cfquery> ...

CFcache - How to cache a web page in ColdFusion

CFcache - cache web page cfcache.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>cfcache tag: how to cache web page in coldfusion</title> </head> <body> <h2 style="color:SteelBlue; font-style:italic">cfcache tag example: how to cache web pages</h2> <hr width="450" align="left" color="SteelBlue" /> <br /> <cfcache timespan="#CreateTimeSpan(0,0,5,0)#"> <cfoutput> <h3 style="color:DeepPink"> This page create at #TimeFormat(Now())# and cache for 5 minutes. </h3> </cfoutput> </body> </html> More ColdFusion examples cfimage - change image height width programmatically cfimage - write an image to the browser cfajaximport - using ajax feature in coldfusion cfsilent ...

ColdFusion CFsetting - How to use enablecfoutputonly attribute

CFsetting - enablecfoutputonly attribute cfsettingEnablecfoutputonly.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>cfsetting: how to use enablecfoutputonly attribute in cfsetting</title> </head> <body> <h2 style="color:DeepPink; font-style:italic">cfsetting tag example: how to use enablecfoutputonly attribute</h2> <hr width="600" align="left" color="OrangeRed" /> <br /> <cfset MyRandomNumber=RandRange(1,100)> <cfsetting enablecfoutputonly="no"> <h3 style="color:SeaGreen"> My random number: <cfoutput>#MyRandomNumber#</cfoutput> </h3> <cfsetting enablecfoutputonly="yes"> <h3 style="color:SeaGreen"> My random number: <cfoutput>#MyRandomNumber#...

How to use CFflush interval attribute in ColdFusion

CFflush - interval attribute cfflush.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>cfflush: how to use interval attribute with cfflush in coldfusion</title> </head> <body> <h2 style="color:DeepPink; font-style:italic">cfflush tag example: how to use cfflush</h2> <hr width="400" align="left" color="OrangeRed" /> <br /> <cfflush interval="1"> <cfoutput> <cfloop index="i" from=1 to="500000"> <cfif i EQ 100000 or i EQ 200000 or i EQ 300000 or i EQ 400000 or i EQ 500000> <h3 style="color:SeaGreen"> The loop current index is: #i# <br /> </h3> </cfif> </cfloop...

How to generate random captcha text in ColdFusion

CFimage - generate random captcha text cfimageCaptchaRandomText.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>cfimage: how to generate random captcha text in coldfusion</title> </head> <body> <h2 style="color:OrangeRed; font-style:italic">cfimage tag example: how to generate random captcha text</h2> <hr width="600" align="left" color="OrangeRed" /> <br /> <cfset MyRandomNumber=RandRange(1000,10000)> <cfset MyRandomText1="CF#MyRandomNumber#"> <cfset MyRandomNumber=RandRange(1000,10000)> <cfset MyRandomText2="CF#MyRandomNumber#"> <cfset MyRandomNumber=RandRange(1000,10000)> <cfset MyRandomText3="CF#MyRandomNumber#"> <table border="1" cellpadding="5" c...

How to compress jpeg image programmatically in ColdFusion

CFImage - compress jpeg image programmatically cfimageCompress.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>cfimage action write: how to compress jpeg image programmatically in coldfusion</title> </head> <body> <h2 style="color:Crimson; font-style:italic">cfimage tag example: how to compress jpeg image</h2> <hr width="575" align="left" color="OrangeRed" /> <br /> <cfimage source="Images/Orchid1.jpg" action="write" destination="Images/Orchid1New.jpg" quality=".4" overwrite="yes" /> <table border="1" cellpadding="5" cellspacing="0" bordercolor="PapayaWhip"> <tr bgcolor="Orange" style="color:Snow; font-size:large...

How to convert image file format jpg to gif programmatically in ColdFusion

cfimage - convert image file format jpg to gif programmatically cfimageActionConvert.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>cfimage action convert: how to convert image file format jpg to gif pngprogrammatically</title> </head> <body> <h2 style="color:Crimson; font-style:italic">cfimage tag example: how to convert image file format</h2> <hr width="575" align="left" color="OrangeRed" /> <br /> <cfimage source="Images/CuteFlower1.jpg" action="convert" destination="Images/CuteFlower1.gif" overwrite="yes" quality=".5"> <table border="1" cellpadding="5" cellspacing="0" bordercolor="IndianRed"> <tr bgcolor="Crimson" sty...

How to use typeahead for autosuggest of Text Box in ColdFusion

CFinput - typeahead for autosuggest in input type text AutosuggestTypeahead.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>cfinput type text: how to use typeahead for autosuggest in input type text</title> </head> <body> <h2 style="color:Crimson; font-style:italic">cfinput type text example: how to use typeahead</h2> <hr width="500" align="left" color="OrangeRed" /> <br /> <cfif IsDefined("Form.SubmitCountry")> <cfoutput> <h3 style="color:DeepPink;"> Your Country is: #Form.Country# </h3> </cfoutput> </cfif> <cfform name="InputTypeTextAutosuggestTest" method="post" format="html"> <table border="1" cellpadding="5...

How to validate maximum length of a Text Box in ColdFusion

cfinput - use maxLength in input type text cfinputTypeTextMaxLength.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>cfinput type text: how to use maxLength in input type text in coldfusion</title> </head> <body> <h2 style="color:SaddleBrown; font-style:italic">cfinput type text example: how to use maxLength</h2> <hr width="475" align="left" color="RosyBrown" /> <br /> <cfif IsDefined("Form.SubmitFlower")> <cfoutput> <h3 style="color:DeepPink;"> Your favorite flower is: : #Form.Flower# </h3> </cfoutput> </cfif> <cfform name="InputTypeTextMaxlengthTest" method="post" format="html"> <table border="1" cellpadding="5...