?
Solved

How can I make the key word search results in bold

Posted on 2003-11-20
3
Medium Priority
?
223 Views
Last Modified: 2013-12-24
How can I make the key word search results in bold. Below are my codes..

<cfquery name="Getbusiness" datasource="#DSNName#">
select * from TB_BusinessDev
where (NameOfBusiness LIKE '%#Search#%') OR (TypeOfBusiness LIKE '%#Search#%') OR (Mission LIKE '%#Search#%')
order by BusinessID
</cfquery>

I would like to make the search keyword to be bold or in a different color. Please Help.
0
Comment
Question by:visa1234_12
  • 2
3 Comments
 
LVL 10

Expert Comment

by:Mause
ID: 9790250
Try this:

#replace(NameOfBusiness, Search, '<b>'&Search&'</b>', 'ALL')#

Let me know
Mause

0
 
LVL 6

Accepted Solution

by:
PE_CF_DEV earned 800 total points
ID: 9790658
#rereplacenocase(NameOfBusiness,"(#Search#)", "<B style=""color:black;background-color:##ffff66"">\1</b>", "ALL")#

This will retain the case of the search so if you search for Street street will not be replaced by Street. Also added the highlighting affect.
0
 
LVL 6

Expert Comment

by:PE_CF_DEV
ID: 9860140
any feedback on this?
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question