Solved

How can I make the key word search results in bold

Posted on 2003-11-20
3
214 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 200 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

680 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