Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
remove unwanted HTML from <textarea> tags
Old 03-08-2008, 05:30 PM remove unwanted HTML from <textarea> tags
Extreme Talker

Posts: 176
Trades: 0
i made a page for a friend, and made him another page that edits it. It prints out all the html, then you can edit it and save it. The only problem is if he presses enter(to organize and stuff), its adds <BR> tags the page. How can I fix this?

And i cant jsut take out all the <BR>s, because he may type one in.
Skeddles is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-08-2008, 11:53 PM Re: remove unwanted HTML from <textarea> tags
Silent77's Avatar
Ultra Talker

Posts: 269
Name: Silent
Location: Ohio
Trades: 0
hard to debug something like that without a link and the code...
maybe you should post both
__________________
Firefox
rediscover the web

Please login or register to view this content. Registration is FREE
Down with internet explorer!
Silent77 is offline
Reply With Quote
View Public Profile Visit Silent77's homepage!
 
Old 03-09-2008, 11:37 AM Re: remove unwanted HTML from <textarea> tags
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
find where the receiving code does a "replace(request.form("text_area_name")),vbcrlf,"< br>")" and comment it out.

may not be exactly as that but you should get something like it.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-03-2008, 09:41 AM Re: remove unwanted HTML from <textarea> tags
Junior Talker

Posts: 3
Name: Dominique Paris
Location: Luxembourg
Trades: 0
Generally, the key solution to remove ALL html tags from an input area is to use a Regex. (I do that in my site).
Here is the sample:
string commentText = Regex.Replace(this.txtComment.Text, @"<(.|\n)*?>", string.Empty).

If you want to preserve the formatting, just use a replace("<br">, "\r\n). This will insert a line feed carriage return.
cultureinside is offline
Reply With Quote
View Public Profile Visit cultureinside's homepage!
 
Old 10-17-2008, 12:28 AM Re: remove unwanted HTML from <textarea> tags
Sean@WMS's Avatar
Skilled Talker

Posts: 52
Name: Sean Connors
Location: Eureka, CA USA
Trades: 0
Quote:
Originally Posted by Skeddles View Post
i made a page for a friend, and made him another page that edits it. It prints out all the html, then you can edit it and save it. The only problem is if he presses enter(to organize and stuff), its adds <BR> tags the page. How can I fix this?

And i cant jsut take out all the <BR>s, because he may type one in.
If I understand you, you don't want to strip all HTML content out at all; you just want to get rid of these pesky break tags.

In the text area field, each of his line breaks is a carriage return/line freed. I agree with @chrishirst that there is most certainly a part of the processing script that is replacing all of those with a break tag.

Frankly, this is generally the right way to go about things. Maybe your friend is missusing line breaks "to organize and stuff"?
__________________
Web Merchant Services

Please login or register to view this content. Registration is FREE
,
Please login or register to view this content. Registration is FREE
Sean@WMS is offline
Reply With Quote
View Public Profile Visit Sean@WMS's homepage!
 
Reply     « Reply to remove unwanted HTML from <textarea> tags
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.21088 seconds with 12 queries