This is how you could call it:

    <font style="font:13px Verdana;font-weight:bold">#highlight('Highlight some text here.','text')#</font>
<br /><br />

As you can see the characters 'text' are highlighted. The format of the string is not altered. You can use this script to
highlight your search results.
<br /><br />

    function highlight(findIn,replaceThis) {
                        foundAt = FindNoCase(replaceThis, findIn);
                        endAt = FindNoCase(replaceThis, findIn) + len(replaceThis);
                        if(foundAt gt 0)
                            findIn =Insert('</span>', findIn, endAt-1);
                            findIn =Insert('<span style="background-color:yellow">', findIn, foundAt-1);
                        return findIn;

About This Tutorial
Author: Nebu Kadnezar
Skill Level: Intermediate 
Platforms Tested: CFMX7
Total Views: 89,565
Submission Date: May 01, 2006
Last Update Date: June 05, 2009
All Tutorials By This Autor: 2
Discuss This Tutorial
  • Works better, avoids a highlight word that might be contained in a html tag.


Website Designed and Developed by Pablo Varando.