Skip to main content
April 19, 2010
Question

How to highlight searched keywords

  • April 19, 2010
  • 1 reply
  • 2576 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.

1 reply

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 22, 2010

I'll try to attach a Word doc with all the code


OK good. In the mean time, why do you have 4 query parameters. There is only one search term, correct?