Blog Home Cartweaver ColdFusion Demos Javascript Music Photos WebDev Whatever

CF_GoogleMap by John Blayter - version 1.4 released

John Blayter has released a new version of his very versatile and ever-so-useful CF_GoogleMap.

Apparently another revision is already in the works with yet more features, but it sounds like some good stuff has been added in already.

http://www.blayter.com/john/index.cfm/2008/6/10/CFGoogleMap-14-Released

(1) Added the showTraffic attribute to the cf_googleMap tag.
(2) Added the showLocalSearch attribute to the cf_googleMap tag.
(3) Added a language attribute to the cf_googleMap tag.
(4) Added the enableZoomScroll to the cf_googleMap tag and defaulted it to true so a use can use their scroll wheel to zoom in and out
(5) Added the enableGE to the cf_googleMap tag and defaulted it to false to enable the Google Earth view of the map.

Truncate text on full words only - a simple version of "full left"

Common scenario: you want to show the first part of a long chunk of text, and then have the full text available via a link like " (more...) " , which would either show the text with javascript (more on that later) or take you to another page to see the full article.

For a long time now I have used the "fullLeft()" udf, which works just fine and does exactly what it should.  But the other day, I got a wild hair and, rather than calling in the fullLeft function to my page, decided to script something right in place... just 'because'.

And whaddyaknow, it works... works great, really.
But it is so simple - what am I missing?

Like most things, my 'aha' is haunted by a 'what if', as in 'what if it breaks on certain characters or other stuff in the text'?  What if I don't really know what the heck I am doing? But ...hey... it works!

//// Here is the logic:

take a chunk of text and a number, passed in as variables.

replace all line breaks in the text with <br> tags (easy to remove if not needed)

if the length of the text is more than the given number, cut it off at that
number of characters

find the number of characters at the end of the remaining string that come after the last space ( ' '), and remove them

if the text was trimmed, output the text in a p tag with a (more...) link  - this can all be modified to give the link a url, or in my case to use javascript to show the full text in place of the truncated content.

/// Here is the code:

<cfscript>
/**
 * Another version of "full left"
 *
 * @param trimlength      Length, in characters, to trim text to (Required)
 * @param rawtext           Text to trim (Required)
 * @return Returns a string with an ellipsis (...) 
 * @author Michael Evangelista (mredesign.com)
 * @created June 6, 2008
 
 Usage:
 <cfinclude template="func/trimtext.cfm">
 <cfoutput>#trimtext(recordbody, 160)#</cfoutput>
 */
 
function trimtext(rawtext, trimlength)
{
// this line replaced line returns in the text block with html breaks
   rawtext = replace(rawtext, chr(13), '<br />', 'all');
      if (len(rawtext) gt trimlength)
   {
   cuttext = left(rawtext, trimlength);
   trimlen = len(cuttext) - len(listLast(cutText, ' '));
   texttouse = left(rawtext, trimlen) & '... <em>(<a class="morelink" href="##">more</a>)</em>';
   }
   else
   {
   texttouse = rawtext;
   }
   textoutput = '<p>' & texttouse & '</p>';
   return textoutput;
   }
</cfscript>


Feedback and/or testing appreciated.
thanks

Demo: Dynamic CF Navigation Menu with 'current page' marker

ColdFusion Navigation Menu Demo

Sometimes you just need a simple menu.

If your list is very long, making a link with a class and an id, typing the href value for each, and inserting the link text all by hand can get old. And then - how do you show which link is the current page?

Here we set up a simple list of url/text pairs, and then loop through that list to create our links.

Then - much like the popular javascript-based 'current page' menus - we look at the value of the link url, and the current page url (cgi.SCRIPT_NAME) - if they are the same, we have a winner. One other thing I find myself commonly wanting is a bit of special css on the first or last item in a list, so the code also assigns IDs to those links.

See the demo   See the code

Catching bounced email with CFPOP

A client sent me a gigantic excel file of email addresses with which to start an email campaign using a simple but effective ColdFusion mailing list program.
Long story short, the list is old and badly maintained, and we are getting almost 1000 bounce messages each time a message is sent. Not good!
We needed an automatic way to parse the bounce messages, getting the addresses contained within, and deleting any email in that list from the mailing list members database. Not finding an easy solution, I created one... kinda crude but it seems to be working great.

The first thing was to create a function that will look at any block of text and find the strings that appear to be email addresses. Then, rather than just go blindly into the account with one big ol' "getall" retrieval, I am getting just the headers and checking how many messages there are.

 Then I break the messages into groups of 500 and loop through those groups - checking for messages with 'Failure' in the subject, and then parsing out the 'body' text value, leaving only an email address, which is simply spit out on the page as a comma delimited list.

( the next step will be a loop through that list, with a DELETE from statement , 'where Email like '%#listIndex#%')

Took me a few times fixing issues, waiting, tweaking details, waiting again... but now it seems to work just fine. I have a list of 1200 bunk addresses to remove from this database!


/// Here is my code ///


<cfsetting requesttimeout="5000">

<!--- Function to strip out email addresses from text --->
<cffunction name="getEmails" output="true" returntype="string">
<cfargument name="text" type="string" required="yes">
<!--- Define local variables --->
<cfset var pos=1>
<cfset var subex="">
<cfset var done=false>
<cfset results = arguments.text>
<cfloop condition="not done">
<!--- Perform search --->
<cfset subex=reFind("([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})", arguments.text, pos, true)>
<!--- Anything matched? --->
<cfif subex.len[1] is 0>
<cfset done=true>
<cfelse>
<cfsavecontent variable="theAddress">
#mid(text,subex.pos[1],subex.len[1])#
</cfsavecontent>
<!---          <cfset results = replace(results,mid(text,subex.pos[1],subex.len[1]),theLink)> --->
<!--- Reposition start point --->
<cfset pos=subex.pos[1]+subex.len[1]>
</cfif>
</cfloop>
<!--- and return results --->
<cfreturn theAddress>
</cffunction>

<!--- figure out how many messages there are --->
<cfpop
server = "mail.ZZZZZZZZZ.com"
username = "mailinglist@ZZZZZZZZZ.com"
password = "ZZZZ
action="getheaderonly"
name="countMail"
>

<cfset mailCount = #countMail.recordCount#>
<cfset loopCount = listFirst(mailcount/500, '.')>
<cfset loopCount = loopCount + 1>
<cfset currentLoop = 0>

Total Messages: <cfdump var="#mailcount#">
<br />
Groups of 500: <cfdump var="#loopcount#">
<br /><br />

<cfloop from="1" to="#loopCount#" index="t">
<cfset startRow = currentLoop*500>
<cfset startRow = startRow + 1>


<!--- check email --->
<cfpop
server = "mail.ZZZZZZZZZ.com"
username = "mailinglist@ZZZZZZZZZ.com"
password = "ZZZZ
action="getall"
name = "getmail"
maxrows="500"
startrow="#startRow#"
TIMEOUT="3000"
>

<!--- query the query, only get errors --->
<cfquery dbtype="query" name="getFailed">
SELECT body FROM getMail
WHERE subject like '%failure%' or subject like '%Failure%'
</cfquery>

<!--- loop query, grab all email addresses --->
<cfloop query="getFailed">
<cfoutput>#getEmails(getFailed.body)#</cfoutput>, <br />
</cfloop>

<cfset currentLoop = currentLoop + 1>
</cfloop>

Show a random image with <cfdirectory>

This is a chunk of code I've had around for a while... fairly useful, felt like sharing.

Basically you're looking in a given folder with <cfdirectory> and pulling out a random image by counting between 1 and the number of images found. Just enter the relative location of your images folder and you're all set.


<!--- set the relative path to the folder with your images --->
<cfset imagesFolder = "./">

<!--- code to look in directory, choose one image at random --->
<cfdirectory directory="#expandPath(imagesFolder)#" filter="*.jpg" name="getPics" action="list"/>
<cfset maxrows = getPics.recordCount/>
<cfset startRow = randRange(1, maxrows)/>

<!--- if one or more photos was found --->
<cfif maxrows gt 0>
    <div class="showPic">
    <cfoutput query="getPics" startrow="#startRow#" maxrows="1">
        <img src="#imagesFolder#/#name#" alt="#listFirst(name, ".")#"/>
    </cfoutput>
    <br /><br />
    Hit refresh or reload to get a different image.
    </div>
</cfif>

NOTE: you might want to give the image a different alt tag, like the name of your site, or... whatever. (this code will use the filename of the image). This same code can be adapted for any files in any directory - change the 'filter' attribute to allow whatever file extension you like.

With CF8, you could get also the height and width of the image to create proper height/width attributes for the <img> tag.

[Update 1/22/08] This mini-tutorial is now featured on learncf.com

demo: GeoEncode any address with cf_googleMap.cfc

http://www.mredesign.com/demos/googlemap-connector/

Enter any address and see it on a googlemap.

This demo was up in another form for quite some time... I was putting a googlemap in a current project and decided to give this a proper place in the demos list.

If you use maps on your pages, you should surely take a look at John Blayter's versatile and well-documented cf_googleMap.cfc

Sitemap XML Generator demo - make a sitemap on the fly with _sitemap.cfc

Make an xml sitemap of any site on the fly!

Being recently and completely impressed with Mike Henke's  Google Sitemap XML Creator , I wanted to see if I could make it work on any site, like a little remote-control spider-bot. Sure enough... this thing is so slick and easy to use, I was able to put the demo together over a coffee break.

The cfc contains another method for submitting the sitemap (removed from demo) and allows deeper spidering - limited here to 2 levels.

This little cfc is a true gem.

The form and resulting code runs out of a single include file, which I will continue to tweak ... if anybody wants a copy just drop me an email.

ColdFusion 8 Release Notes, cfajax 'issues'

http://www.adobe.com/support/documentation/en/coldfusion/8/releasenotes.pdf

I came across this lovely little doc via a link in a CMX article by Chaz Chumley, about basic uses of CFLAYOUT. Looking at the first few pages of the Release Notes, it seems there are still quite a few caveats to all of the new lovely CFAJAX stuff.
( If using abc browser and this tag is inside that tag, xyz happens or doesnt happen or... ) It makes my head spin, and makes me more than just a little hesitant to dive into CFLayout for wrapping my applications.

I would be interested to hear from others who have adopted CFAJAX as part of a regular workflow. Mostly wondering if the little quirks and bugs are as tedious as they seem, and if it'd be more worthwhile to stick to 'rolling my own' js / ajax layouts (which in this case would mean learning and using Ext directly, rather than the CF tags that control it).

InkedPress.com - customized CartWeaver coldfusion ecommerce site with jQuery photo selector

Inkedpress.com - new custom eCommerce website launched today!

Built with a highly customized CartWeaver ColdFusion back end and a slick jQuery / javascript image selector routine, the Inked Press site allows the user to enter any word or phrase, and select from a gallery of images to represent each letter, building a custom "Picture Font" personalized photo frame.

This was a fun project from start to finish, and everybody involved is pleased with the outcome. The custom image selection routine for building the Picture Fonts was my first 'heavy' usage of jQuery... and it made the entire process such a pleasant experience, I am already hungry for another custom js site!

Playing with CFimage - a CF demo

Since I first heard about CF8 earlier this year, I have been eagerly waiting to get my hands on the new image functions.  Tonight, while watching the Red Sox walk all over the Indians on their way to the World Series, I spent some time with Ben Nadel's excellent cfimage tutorials (part I and II), and built this fun little demo  to show  off some of the functions.

Overall I am extremely impressed with both the speed and quality, especially for resizing. As I understand it, the java image resizing functions have been greatly improved upon, and the fact that quality is so easily controllable - by passing a value between 0.0 and 1.0 - is really nice.

There are a lot more things that CFimage can do... but this demo gives you some of the basics: www.mredesign.com/demos/cfimage-example/index.cfm

Reordering mySQL table columns

This has bugged me for a while. With some projects, I inherit huge tables, or I have tables where I have added fields on after the fact, over and over, and when I go to work on the table or print the list of columns using Navicat, the natural order of the columns makes no kinda sense.

So... I went looking for a method to alphabetize my tables. Since mySQL doesnt care about the column order, why not make it easy on myself?


Easy enough, right... run a Select * query against the table, and then write a new query to insert the 'columnList' from that query into a new table. Welllll..... CFquery returns the column names in all caps - yuck.
I don't want to change the case of my column names, usually in camel case like "recordNameLast"  - All Caps there could cause issues for sure!

Along comes a cool function, thanks to google, and the leftcorner folks:
http://www.leftcorner.com/index.cfm?Article=ListQueryColumn

This gets the field names in properCase, but then, it also preserves the current order which defeats the whole purpose.

So... I needed to use this to get a list of names with correct case.
Then reorder that list, and *then* insert into the new table.

Here it is... I wrote in an option at the top to turn ABC on.
You can set this to 0 if you want the new list of names in current order and case.
There is also an option to turn off making the new database table,
if you  simply want to get the comma delimited list of column names for other uses.

============================

<!--- This script uses a function from
http://www.leftcorner.com/index.cfm?Article=ListQueryColumn
to create a copy of a mySQL table, using the correct case of the column names --->

<!---  EDIT these settings  --->
<!--- set table name --->
<cfset currentTable = "tbl_to_copy">
<cfset newTable = "tbl_new">
<!--- use listSort to put in ABC Order ?--->
<cfset ABC=1>
<!--- make a new table in the database? --->
<cfset makeTable=1>
<!--- / Edit --->

<!--- this function returns correct case --->
<cffunction name="ListQueryColumn" access="public" returntype="string" output="false"
hint="Returns a comma-delimited list of columns in a query in correct order and case">
<cfargument name="QueryObject" type="query" required="true">  
<cfreturn ArrayToList(Arguments.QueryObject.getMetadata().getColumnLabels())>
</cffunction>

<!--- get column names from current table --->
<cfquery datasource="#request.dsn#" name="getCols" maxrows="1">
SELECT * from #currentTable#
</cfquery>
<!--- set up list --->
<cfset columnList = "#listQueryColumn(getCols)#">

<!--- alphabetize the list --->
<cfif ABC eq 1>
<cfset columnList="#listSort(columnList,"TextNoCase", "Asc")#">
</cfif>

<!--- create new list variable --->
<cfset newList="#columnList#">

<cfif makeTable eq 1>
<!--- change table --->
<!--- if there's a table with the newTable name - delete it --->
<cfquery name="prepD" datasource="#request.dsn#">
DROP table #newTable#
</cfquery>
<!--- create the new table! --->
<cfquery name="changeD" datasource="#request.dsn#">
create table #newTable# as select #newList# from #currentTable#
</cfquery>
</cfif>

<!--- show on page --->
<cfdump var="#newList#">


============================

One caveat = this generic method does not seem to carry over the primary key for your table. You'll need to either modify this to set the specific ID field after making the new table, or just open your new table in Navicat or phpMyAdmin and set that primary key.

Super simple random text display

Playing around with my brand-new demos site (rather than actually adding another demo like I sat down to do), I decided I wanted a random subheader on the main page, like the coldfusionbloggers.org site

And whaddya know - while uber-supremely simple cf-wise, it makes for a cutesy little demo in and of itself.

Here's the rub...

First, I put a bunch of stuff into a list variable
using a pipe '|' for a delimiter (so I can use commas in my slogans)

<!--- goofy slogans --->
<cfset sloganList="
Slogan1|
Slogan2|
Witty saying|
Stupid quote|
Senseless garbage|
Funny, at least at the moment|
Something else|
Got the idea yet?
">

Then, get one of the items in the list, at random,
using listLen to get the length of the list and declaring
my pipe character as the delimiter

<cfset goofySubHead=listGetAt(sloganList, randRange(1, listLen(sloganList, '|')),'|')>

and then, in my page's header,
<h2>#goofySubHead#</h2>

That's it!

If you want to see it at work, just click here
and then refresh the page to see the slogan change
( or don't... see if I care... fine, be that way!)

Easy cfparams for all columns in a table

I have a site with several large forms posting to the same database, and with multi-step forms where I need to pass the values around in session.variables between steps, allowing the user to go forward or back as needed until they submit the whole form, and the entire thing gets passed to the database.

Rather than manually typing out a <cfparam name="session.columnName" default=""> for every field in the form, I just came up with a way to get the whole thing done for me in one fell swoop. ( I am sure this is not original, but it is a new idea that just hit me, and works great).

<!--- dynamically create params for every field in the table --->
<cfquery datasource="#request.dsn#" name="getCols" maxrows="1">
SELECT * from MY_TABLE_NAME_HERE
</cfquery>

<cfloop list="#getCols.columnlist#" delimiters="," index=column>
<cfoutput>
<cfparam name="session.#column#" default="">
</cfoutput>
</cfloop>

That's it!
Then, putting  this on the page verifies its all working
<cfdump var="#session#">

Cartweaver Search mod: subcats as keywords / auto-submit select box

I just spent a few minutes tweaking the way the default Cartweaver categories search form works - it is fairly basic form javascript, but I think it might be useful to others...

This site is in progress - client has added (and named, sometimes a bit off-spelling) his products, and the CW functions are all up and working.
http://enchanted-light.com/Results.cfm?secondary=17

Rather than the standard secondary category functions, with this site we wanted a 'keyword' search function, much like the tags commonly assigned to blog posts. Most of his photos have multiple secondary categories assigned, so a picture of a river by a mountain for example, would show up under both rivers and mountains. you get the idea.

Cartweaver's search function allows for all sorts of configurations in the call for the search (see the default index.cfm page when you install CW... here is a sample - this is all the default search types plus a few custom ones I keep around... in this case we're working from the one labeled "All form defaults used"). I have the call to the search tag in place in my 'results' page, and have opted to turn off the text box search and the main category search, simply leaving the 'secondary' category search and a submit button with a value of "Go".

anyway... rather than requiring the viewer to select the option and click the submit button to run the search, I thought it would be slick if the select box auto-submitted the form when changed. So... in the cw tag that handles the search function, I simply added this to the <select> dropdown code

onchange="document.<cfoutput>#attributes.formid#</cfoutput>.submit()"

so the whole line for the select now looks like this:
 <select name="secondary" id="<cfoutput>#attributes.formid#</cfoutput>-secondary" onchange="document.<cfoutput>#attributes.formid#</cfoutput>.submit()">

(Note, I could have hand-coded the attributes.formID part since I am only using this once in the page, but this method is copying the ID given to the form by cartweaver through the FormID variable)

However... this alone does not work... because...
the default name for the submit button is - can you guess? - "submit", and , left to itself, my javascript code above makes the browser think its trying to do something with that button, rather than submit the form. So the easy fix - rename the submit button to "btnSubmit".

<input name="btnSubmit" type="submit" class="formButton" value="<cfoutput>#attributes.buttonlabel#</cfoutput>"> 

I could also have just removed (commented out) the submit button, since the dropdown now submits the form when changed, but if javascript is disabled, you need the button, so renaming it is the easy fix.

That's a long post for a short mod... hope it helps somebody some time.

New Features of CF8 - pdf presentation

I was all set to take part in my first Adobe eSeminar today - registered and everything - and then got tied up with clients until the thing was almost over. However, Jason Delmore, presenter, just posted a pdf version of the presentation on his blog.

http://www.cfinsider.com/downloads/ColdFusion%208%20-%20Customer%20-%20Jason.pdf

This is probably like reading the Cliff Notes rather than actually seeing a good movie, but there are some good points in the pdf nonetheless.

CF Instant Gallery demo :: upload a zip file, get a gallery!

This is just a simple demo, no database or xml (yet) so no captions or other data, but the function is fun, and easy...
http://www.mredesign.com/demos/zipGallery/index.cfm

Upload a zip file containing some jpg images, give your gallery a unique name (folder with same name will be created on server) and then wait... while the server uploads and unzips the file (with zip.cfc), resizes all of the photos (using Massimo's tmt_img.cfc) and then displays a gallery ready-to-go.

Current skins include Project Seven's Slide Show Magic and Image Gallery Magic, plus the interesting (and easy) FrogJS Gallery and a quick HoverBox CSS Gallery

Go ahead... try it!
If you have any problems / errors, please let me know by leaving a comment on this post.
(or if you don't want to wait, there are some sample galleries on the right side of the upload form)

This was just a quick workbench experiment, to show the upload/unzip/resize routine in action.
Future plans for the 'real' gallery include either an xml or mySQL back end, with captions, titles, categories, etc for a full-blown instant gallery maker.

All comments appreciated.



Updated: CF Image Uploader / Resizer with tmt_img.cfc

Decided to get serious (ok... serious'er') about the look and feel of these demo-things I keep playing with. I grabbed a quick css template courtesy of styleshout.com and set up some workspace.

First up - the same ColdFusion Image Resizer demo I posted back in December, with a new skin...
http://www.mredesign.com/demos/tmtImg-Uploader/

Kinky Calendar - free coldfusion calendar system

Thanks to Dan Vega for pointing out another, more complex CF calendar (complex, robust, neat-o... whatever... it does more stuff)... check it out!

+++++++++++

The Kinky Calendar System is a totally free ColdFusion calendar system that was designed, not as a stand-alone application, but rather as a module that could be easily integrated into an existing piece of ColdFusion software. Using only two database tables and extremely simple queries, this system should work on just about any database application, event the dreaded Microsoft Access.

The Add / Edit interfaces have been kept purposefully simple. It is my assumption that any application that integrates with this free ColdFusion calendar system will already have widgets for date and time selection. Those widgets should be inserted in place of my standard text inputs.

View The Online Demo Here »

Features

  • Year / Month / Week / Day View
  • Repeating events:
    • Daily
    • Weekly
    • Bi-Weekly
    • Monthly
    • Yearly
    • Monday - Friday
    • Saturday - Sunday
  • Partial event series manipulation and exception creation:
    • Entire event series
    • All future instances of event
    • Current event instance only
  • Color coding of events
  • SQL build scripts for event tables

Database Driven CF Calendar

John Ramon has a nice little tutorial at easycfm.com that shows, in very well-explained terms, how to build a database-driven calendar based on Ray Camden's CF Calendar example.

seems like people are always asking about calendar apps for their ColdFusion sites (myself included)... this looks like a great solution

Automagic links for http: and mailto: from plain text content

A while back, I built a simple cms system for an article-based site where some of the articles have links and email addresses built in. My client wanted to be able to simply copy and paste the articles into the textarea, and not have to fuss with making each of the links. (that, and I really didn't want to turn her loose with fckeditor in this case... 'just the facts, ma'am")

So, I jumped over to experts-exchange, and within minutes of posting my question, one of the legions of experts in the ColdFusion arena gave me this nice bit of regular expressionism, wrapped up in a nice little function (ok, two functions)

It will find anything starting with http://, www., or http://www, and turn it into a link.   Anything in email format ( something@something.something) gets made into a mailto: link.


========================

<!--- This function creates hyper links from url strings,
and email mailTo links from email addresses --->

<cffunction name="LinkURLs" output="true" returntype="string">

<cfargument name="text" type="string" required="yes">
<!--- Define local variables --->
<cfset var pos=1>
<cfset var subex="">
<cfset var done=false>
<cfset results = arguments.text>

<cfloop condition="not done">

<!--- Perform search --->
<cfset subex=reFind("(http://|http://www|www)(.*?)([[:space:]]|$)", arguments.text, pos, true)>
<!--- Anything matched? --->
<cfif subex.len[1] is 0>
<cfset done=true>
<cfelse>
<cfsavecontent variable="theLink"><a href="http://#replace(mid(text,subex.pos[1],subex.len[1]),'http://','')#">#mid(text,subex.pos[1],subex.len[1])#</a></cfsavecontent>
<cfset results = replace(results,mid(text,subex.pos[1],subex.len[1]),theLink)>
<!--- Reposition start point --->
<cfset pos=subex.pos[1]+subex.len[1]>
</cfif>
</cfloop>

<!--- and return results --->
<cfreturn results>
</cffunction>

<cffunction name="LinkEmails" output="true" returntype="string">

<cfargument name="text" type="string" required="yes">
<!--- Define local variables --->
<cfset var pos=1>
<cfset var subex="">
<cfset var done=false>
<cfset results = arguments.text>

<cfloop condition="not done">

<!--- Perform search --->
<cfset subex=reFind("([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})", arguments.text, pos, true)>
<!--- Anything matched? --->
<cfif subex.len[1] is 0>
<cfset done=true>
<cfelse>
<cfsavecontent variable="theLink"><a href="mailto:#mid(text,subex.pos[1],subex.len[1])#">#mid(text,subex.pos[1],subex.len[1])#</a></cfsavecontent>
<cfset results = replace(results,mid(text,subex.pos[1],subex.len[1]),theLink)>
<!--- Reposition start point --->
<cfset pos=subex.pos[1]+subex.len[1]>
</cfif>
</cfloop>

<!--- and return results --->
<cfreturn results>
</cffunction>

===================

To call the function, I simply used
#linkEmails(linkUrls(recordDescrip))#
where #recordDescrip# is my article text

easy, eh?

Add your own functions to CFFORM's built-in validation

Sean Corfield over at learncf.com has a nice, short explanation of a 'better' way to add your own validation scripts using onSubmit, while still keeping the built-in functions of CFFORM's own validation intact.

http://tutorial8.learncf.com/

More Entries

Powered by BlogCFC version 5.5.005 by Raymond Camden.   Reinit  Admin