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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying Variables with HTML code in it?

Status
Not open for further replies.

YvonneTsang

Programmer
Sep 28, 2001
37
CA
I have a variable that retrieves some HTML code and I want to output the literal version of the code onto the screen with a label or span. so if I get Yvonne<br>Tsang from the input. I want the span to display

Yvonne<br>Tsang

not

Yvonne
Tsang

How do I go about doing this??

 
[tt]

How about:

Variable(&quot;first_name&quot;) & &quot;<&quot; & &quot;br&quot; & &quot;>&quot; & Variable(&quot;last_name&quot;)
* * * * * * * * * * *
<%=Tony%>
cold.gif

 
you'll need to incorpurate some character entities
try this one out
dim str
str = &quot;Yvonne&#60;BR&#62;Tsang&quot;
Response.Write str _______________________________________________
{ str = &quot;sleep is good for you. sleep gives you the energy you need to function&quot;;
ptr = /sleep/gi;Nstr = str.replace(ptr,&quot;coffee&quot;);alert(Nstr); }

_______________________________________________
for the best results to your questions: FAQ333-2924
 
str=Replace(str, &quot;>&quot;, &quot;&gt;&quot;)
str=Replace(str, &quot;<&quot;, &quot;&lt;&quot;)
Response.Write str
 
forgot the tgml
str = &quot;Yvonne&#60;BR&#62;Tsang&quot; _______________________________________________
{ str = &quot;sleep is good for you. sleep gives you the energy you need to function&quot;;
ptr = /sleep/gi;Nstr = str.replace(ptr,&quot;coffee&quot;);alert(Nstr); }

_______________________________________________
for the best results to your questions: FAQ333-2924
 
urggggg!!!!!!!!!

take out the spaces
str = &quot;Yvonne& # 6 0 ; BR & # 6 2 ; Tsang&quot; _______________________________________________
{ str = &quot;sleep is good for you. sleep gives you the energy you need to function&quot;;
ptr = /sleep/gi;Nstr = str.replace(ptr,&quot;coffee&quot;);alert(Nstr); }

_______________________________________________
for the best results to your questions: FAQ333-2924
 
LoL, tgml got me too.
Replace the second parameter in my function calls with

& g t ;
and
& l t ;

(lose the spaces)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top