Wee Ler Ping
|
| Posted: 03/13/2002, 10:16 AM |
|
Dear people,
How do I change the following ASP code for highlighting Search results
(Turning the matching words Red as showned in the Tips section) for JSP?
Especially the Replace syntax
if GetParam("name") <> "" then
string_to_split = GetParam("name")
tok = split(string_to_split, " ")
for i = 0 to ubound(tok) step 1
if i = 0 and i = ubound(tok) then
sWhere = sWhere & " and i.name like '%"& tok(i) &"%'"
elseif i = 0 then
sWhere = sWhere & " and (i.name like '%"& tok(i) &"%'"
elseif i = ubound(tok) then
sWhere = sWhere & " or i.name like '%"& tok(i) &"%')"
else
sWhere = sWhere & " or i.name like '%"& tok(i) &"%'"
end if
next
end if
___
if GetParam("name") <> "" then
string_to_split = GetParam("name")
tok = split(string_to_split, " ")
for i = 0 to ubound(tok) step 1
fldname = replace(fldname, tok(i), "<font color = red>"& tok(i) &"</font>")
next
end if
Yours,
Marilyn
|
|
|
 |
|