webForumDet fria alternativet

Nat skumt med replace...

4 svar · 213 visningar · startad av annesophie

annesophieMedlem sedan juni 20012 236 inlägg
#1

Jag forsoker att markera en sokt text eller ett sokt ord (som kommer in pa sidan via en querystring = highlight). Det funkar.

Problemet ar att, trots att highlight delen funkar som den ska, sa hander nat med tabellen. Om jag, som i nedan exempel, anvander replace pa tex (rs("features")) sa laggs (rs("features")) delen utanfor tabellen...den hoppar liksom ur sin cell. Om jag inte anvander replace sa ligger informationen snyggt och prydligt kvar i sin cell.

Kan ni se vad jag gor fel???????????? :q

Detta ar da en del av min string.

		strList = strList & "				<tr>" & vbcrlf
		strList = strList & "					<td colspan=""3"" class=""breadjustify"" valign=""top"">" & vbcrlf
		strList = strList & "						"& strOutline &"" & vbcrlf
		strList = strList & "						<p><b>Features:</b></p>" & vbcrlf
		[b]strList = strList & "                                           "& response.write (replace(rs("features"),highlight, "<b>" & highlight & "</b>",1,-1,vbTextCompare)) &"" & vbcrlf[/b]
		strList = strList & "						<p><b>Specification:</b></p>" & vbcrlf
		strList = strList & "						"& rs("specification") &"<br>" & vbcrlf
		strList = strList & "						"& strOutline2 &"<br>" & vbcrlf
		strList = strList & "					</td>" & vbcrlf
		strList = strList & "				</tr>" & vbcrlf

...sa har sag det ut innan...da det ligger kvar i cellen:


		strList = strList & "					<td colspan=""3"" class=""breadjustify"" valign=""top"">" & vbcrlf
		strList = strList & "						"& strOutline &"" & vbcrlf
		strList = strList & "						<p><b>Features:</b></p>" & vbcrlf
		[b]strList = strList & "						"& rs("features") &"" & vbcrlf[/b]
		strList = strList & "						<p><b>Specification:</b></p>" & vbcrlf
		strList = strList & "						"& rs("specification") &"<br>" & vbcrlf
		strList = strList & "						"& strOutline2 &"<br>" & vbcrlf
		strList = strList & "					</td>" & vbcrlf

HELP! Vad ar det jag missar??

/A

annesophieMedlem sedan juni 20012 236 inlägg
#2

*snyft*

Vart ar LarsG???

doggelitoMedlem sedan juni 20003 076 inlägg
#3
strList = strList & "<tr>" & vbcrlf
strList = strList & "<td colspan=""3"" class=""breadjustify"" valign=""top"">" & vbcrlf
strList = strList & strOutline & vbcrlf
strList = strList & "<p><b>Features:</b></p>" & vbcrlf
strList = strList & replace(rs("features"),highlight, "<b>" & highlight & "</b>",1,-1,1) & vbcrlf
strList = strList & "<p><b>Specification:</b></p>" & vbcrlf
strList = strList & rs("specification") & "<br>" & vbcrlf
strList = strList & strOutline2 & "<br>" & vbcrlf
strList = strList & "</td>" & vbcrlf
strList = strList & "</tr>" & vbcrlf
annesophieMedlem sedan juni 20012 236 inlägg
#4

TACK!

doggelitoMedlem sedan juni 20003 076 inlägg
#5

Alltid roligt när man kan hjälpa till! :)

132 ms totalt · 3 externa anrop · v20260731065814-full.30151723
0 ms — hämta forumlista (cache)
0 ms — hämta statistik (cache)
129 ms — hämta tråd, inlägg och bilagor (db)