Skip to main content
April 19, 2010
Frage

How to highlight searched keywords

  • April 19, 2010
  • 1 Antwort
  • 2571 Ansichten

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?

Dieses Thema wurde für Antworten geschlossen.

1 Antwort

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....

April 21, 2010

>Am I on the right track with something  like this?

Uh, no. You need to modify the page that outputs the recordset results, not the page with the user input form. Can you post that page?


It's one in the same:  http://www.petspathhome.com/lostcats_main.asp