Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Basics
Password Reminder
Register
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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.
Reply With Quote
  #2 (permalink)  
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..
Reply With Quote
  #3 (permalink)  
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.
Reply With Quote
  #4 (permalink)  
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.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 10:54 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.