Print Page | Close Window

Highlighting

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=14720
Printed Date: 28 March 2026 at 5:51am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Highlighting
Posted By: zMaestro
Subject: Highlighting
Date Posted: 16 April 2005 at 2:28pm
I want to highlight some words when reading from database, i use this simple script to read:
<%
sql = "SELECT * FROM TableName"
 
set r = Server.CreateObject("Adodb.Recordset")

r.open sql, Conn, 1, 3

Response.Write ""&r("username")&"<br>"

r.close : Set r = nothing
%>
 
how can i Highlight some certain characters within r("username") based on a querystring
 
Thanks.



Replies:
Posted By: dj air
Date Posted: 16 April 2005 at 2:31pm
are you wanting to use like a search function where if the username contains the letters within a querystring highlight that?

if so have a look at the forum search page, it does that exact thing.


Posted By: zMaestro
Date Posted: 17 April 2005 at 7:57pm
i looked at it, but didn't know how to implement it, it was a sub function in the header of the file, i'm looking for the simplest way implemening it Embarrassed


Posted By: C.P.A.
Date Posted: 26 April 2005 at 10:27am
you could simply convert the 'to highlight text' into a string and take a replace function to search for that word or words and replace them with <span class="highlight">that word</span> and it will highlight the words.

-------------
C.P.A. » The more you find out about the world, the more opportunities warmly welcome you.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net