Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 9th, 2010, 11:57 AM
Authorized User
 
Join Date: Sep 2008
Location: , , .
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default Formatting Textarea content back into HTML

Hi

I am a bit stuck.

I have an asp page with a textarea in a form. I can insert/modify text and store it into an access databasehttp://images.intellitxt.com/ast/adTypes/2_bing.gif no problem but I would like to do the following:

1) enter text in the textarea and have the ability to add an href and/or embolden some words (very basic formatting). Submit this to the database in a memo field.
2) when the asp page is viewed in the browser, I would like to display the content with the href tag and the <strong></strong> tags parsed in the normal way by the browser.

Is there an easy way to do this and examples if possible? I don't want to have to download and learn tinymce or cuteeditior for something so simple.

Any help will be much appreciated.
 
Old February 9th, 2010, 04:51 PM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

Already answered in another forum.

You know, if you are going to post in multiple forums, the least you can do is come back and mark your threads in the other forums as RESOLVED.

*sigh*

Last edited by Old Pedant; February 9th, 2010 at 04:53 PM..
 
Old February 9th, 2010, 04:57 PM
Authorized User
 
Join Date: Sep 2008
Location: , , .
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default Resolved

Hi

Thank you for the reply. I must be going mad - been a long day. I have been using a checkstring function which looks after illegal content which could break the SQLhttp://images.intellitxt.com/ast/adTypes/2_bing.gif when inserting into the database - such as ' and <> as ' and </html> could break the page display.

I had forgotton about the <> which stopped allowing href or tags.

Thanks for the help (it was a help and forced me to check my code).

I am now just checking and conditioning the ' but allowing tags to be entered. I will just need to be careful when people add content tags.
 
Old February 9th, 2010, 07:25 PM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

So rewrite the checkstring function to strip out all except the simplest tags.

Note that even a <span> tag can be dangerous. As in
Code:
<span onmouseover="document.write('your page is history!');">stuff</span>
You probably want to do as this forum does: Only allow [xxx] tags and then transform only the ones you know about and deem safe into <xxx> tags.




Similar Threads
Thread Thread Starter Forum Replies Last Post
How to insert textarea content into MySQL? a5xo3z1 Beginning PHP 14 October 2nd, 2008 01:47 PM
change content of textarea from select darkhalf Javascript 1 April 26th, 2007 06:03 AM
Displaying textarea content to html table keithc Pro PHP 2 December 1st, 2006 03:12 AM
TEXTAREA tag in html sapphire87 PHP How-To 0 July 26th, 2006 02:25 PM
html textarea to DB ginoitalo Beginning PHP 1 May 30th, 2005 01:49 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.