htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: htmlArea 2: htmlArea 2 & 3 archive (read only): htmlArea v2.0:
Remove HTML tags when saving to DB


The htmlArea 2 & 3 editors have been discontinued.

We've made these forums available as a read-only reference and knowledge-base for people using or developing editors based on htmlArea 2 or 3.

Anyone who is interested in taking over version 2 or 3 is free to do so. All we ask is that you choose a new name that doesn't have "htmlarea" in it to avoid confusion with this site. We'll even give you a link in the directory to make it easier for people to find you. If you are developing or hosting an htmlArea based-editor under a new name, please submit it to our directory.

 


budenk
New User

Dec 23, 2004, 10:46 AM

Post #1 of 5 (2110 views)
Shortcut
Remove HTML tags when saving to DB Can't Post

How to remove HTML tags from htmlArea when saving to DB?


bootlicker
Novice

Dec 29, 2004, 8:43 AM

Post #2 of 5 (2023 views)
Shortcut
Re: [budenk] Remove HTML tags when saving to DB [In reply to] Can't Post

Well, here's a brute force method. Someone else may have a more elegant solution.

Just use the Replace function to replace the tags with "". You could put all the possible tags into an array and loop through them:

For Each item in arrTags

Replace(strHTMLAreaText, item, "")

Next

Hope that points you in the right direction.


Luis
Veteran

Dec 29, 2004, 12:20 PM

Post #3 of 5 (2018 views)
Shortcut
Re: [budenk] Remove HTML tags when saving to DB [In reply to] Can't Post

Hi budenk:

One curious question:

Why would you use HTMLArea if you are going to remove the HTML tags at the end, instead of using a common textarea?

Your answer is important to determine which method works better. Even when the approach is correct, the previous post is a little misleading because bootlicker is assuming you are using a particular Server Side language.

Greetings


Don't give up!!
http://webstationone.com/test/htmlarea


budenk
New User

Dec 29, 2004, 12:27 PM

Post #4 of 5 (2009 views)
Shortcut
Re: [Luis] Remove HTML tags when saving to DB [In reply to] Can't Post

I need to save all text only to the database.

That text need to be plain text because the other application will use it.

If the tags are included, the text will be hard to read.


Luis
Veteran

Dec 29, 2004, 12:42 PM

Post #5 of 5 (2003 views)
Shortcut
Re: [budenk] Remove HTML tags when saving to DB [In reply to] Can't Post

If you want the output be plaintext, then don't use htmlarea. Use a common textarea instead.

If you want your output file be generated in rich text format, instead of showing the tags, then it's a server-side issue. I don't know which server-side language you are using, but you need to add a header to the script that display your content to tell it that it must be displayed in HTML format.

perl: print "Content-type: text/html\n\n";

php: <?php header('Content-type: text/html');?>


Don't give up!!
http://webstationone.com/test/htmlarea

 
 
 


Search for (options)