Skip to main content
April 19, 2010
Question

How to highlight searched keywords

  • April 19, 2010
  • 25 replies
  • 2604 views

I'd like my keyword search results to be highlighted. I have a simple (wildcard) keyword search box on my dynamic pages with results appearing on the same page. The code is:

<%
Dim rs_lostcats__MMColParam
rs_lostcats__MMColParam = "%"
If (Request.Querystring("search") <> "") Then
  rs_lostcats__MMColParam = TRIM(Request.Querystring("search"))
End If
%>

.....and my form code is:  <input name="search" type="text" id="search" value="<%= Request.Querystring("search") %>" />

Can someone help?

This topic has been closed for replies.

25 replies

Participating Frequently
April 19, 2010

You can use VBScript Replace() function to replace the search term with the search term + formatting.

April 19, 2010

I've researched about that method, but since I don't write script, I'm not sure where or how to apply the Replace() function.  Would I add it to the script I've already got (listed above) or do I need a separate function?  And then would I write a Response.write function for the input field?  Thanks for your help again, I'm so darn close to achieving all I need for now....

Participating Frequently
April 19, 2010

>Would I add it to  the script I've already

>got (listed above) or do I need a separate  function?

You would need to add it to the script that outputs the results.