Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

highlight upper case problem with replace

Status
Not open for further replies.

amisima

Programmer
Jun 11, 2003
13
0
0
CA
Hi I am trying to highlight my search results. I have a replace function, when I highlight the search result the rest of my results changes into upper case. This is what my code looks like:

<%if InStr(ucase(rs(&quot;EN&quot;)),ucase(search_criteria)) <> 0 then %>
<td><B>{EN}</B></td>
<%
pos=InStr(ucase(rs(&quot;EN&quot;)),ucase(search_criteria))
chunk=Mid(rs(&quot;EN&quot;),pos,Len(search_criteria))
MyHighlight=Replace(ucase(rs(&quot;EN&quot;)), ucase(search_criteria), &quot;<SPAN STYLE=background:#FFFF00>&quot;& chunk &&quot;</SPAN>&quot;)
%>
<td><b><%Response.Write (MyHighlight)%></b></td><%
else
if rs(&quot;EN&quot;) <> empty then
%>
<td><B>{EN}</B></td>
<td><b><%response.write(rs(&quot;EN&quot;))%></b></td><%
end if
end if%>

can anyone help?

Thanks

Amisima
 
try
MyHighlight=Replace(ucase(rs(&quot;EN&quot;)), ucase(search_criteria), &quot;<SPAN STYLE=background-color:#FFFF00;>&quot; & chunk &&quot;</SPAN>&quot;)


____________________________________________________
[sub]Python????? The other programming language you never thought of!
thread333-584700[/sub]
onpnt2.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top