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!

Convert HTML in a TEXTAREA

Status
Not open for further replies.

qwert62

Programmer
Oct 12, 2000
28
0
0
US
Is it possible to convert HTML tags in a textarea?

I am pulling a field out of a database that contains HTML tags. I need to display it in a Textarea without the HTML tags.

For example the value in field is:

<p style='font-family:verdana;font-size:10pt;'>Dear David,<BR><BR> Thank you.

In the textarea I want to display:

Dear David,

Thank you


Thanks in advance for any suggesions.
 
Could you not use Server.HTMLEncode on the value being passed into the TEXTAREA?

------------------------------------------------------------------------------------------------------------------------
"The major difference between a thing that might go wrong and a thing that cannot possibly go wrong is that when a thing that cannot possibly go wrong goes wrong it usually turns out to be impossible to get at or repair."
--Dou
 
I am not too familiar with Server.HTMLEncode, but I think I am trying to accomplish the opposite of Server.HTMLEncode.
 
From your first post, it appears you want it to print in the textarea without the tags - which is what Server.HTMLEncode will help you to do. For further information on it, check here:
[URL unfurl="true"]http://www.devguru.com/Technologies/asp/quickref/server_htmlencode.html[/url]

------------------------------------------------------------------------------------------------------------------------
"The major difference between a thing that might go wrong and a thing that cannot possibly go wrong is that when a thing that cannot possibly go wrong goes wrong it usually turns out to be impossible to get at or repair."
--Dou
 
re-reading his post it seems like he's trying to HTML parse the info instead of encode it.

as for a text area, you wont see bold, list items, text boxes, etc, about the only one you'll need to worry about is <BR> and you can replace(RS("fieldname"),"<br>",vbcrlf)
 
DreXor,

You may be right. That did not occur to me. Good catch! :)

------------------------------------------------------------------------------------------------------------------------
"The major difference between a thing that might go wrong and a thing that cannot possibly go wrong is that when a thing that cannot possibly go wrong goes wrong it usually turns out to be impossible to get at or repair."
--Dou
 
i dont think what he askes can be done, he wants the <br> to be displayed in a normal Textarea that doesnt take any html tags.

qwert62, why dont u try a WYSYWYG editor???

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top