Wrox Programmer Forums
|
Classic ASP Components Discussions specific to components in ASP 3.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Components 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 January 20th, 2005, 03:27 AM
Registered User
 
Join Date: Dec 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default regarding textarea in asp

hi

advance thanks. in asp if i give the enter button in the text area it stores in the database as a pipe symbol. while retrieving that record i can't get the data into that text area. how i can eliminate this problem. Thanks

Kalyanaraman Narayanan
 
Old January 20th, 2005, 01:16 PM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Are u explicitly storing pipe charecter in textarea..? Because in database newline charecter is stored i think, and while retriving data, it displays data as entered.


Om Prakash
 
Old January 20th, 2005, 06:07 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

I believe the enter button should not store a pipe.

I run this function every time I do an insert, will fix your problem Id say:

  Function StoreText(theText)
    StoreText = ""
    on error resume next
    StoreText = CStr(theText)
    if (len(StoreText) > 0) Then
      StoreText = Replace(StoreText, """", """, 1, -1, 1)
      StoreText = Replace(StoreText, "'", "''", 1, -1, 1)
      StoreText = Replace(StoreText, vbCrLf, "<BR>", 1, -1, 1)
    end if
  End Function

When you do am insert also run the trim function, should be run on all inserts and updates where the value has come from user input, Use it like so:

trim(storeText(request.form("formElementName")

Wind is your friend
Matt
 
Old January 21st, 2005, 01:14 AM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

After you use the StoreText function to insert or update, use the following when getting data back out to show in the texarea:

Function DisplayMemo(theText)
   if (len(theText) > 0) Then DisplayMemo = Replace(theText, "<BR>", vbCrLf)
End Function

<textArea>DisplayMemo(rs(0))</textArea>

Wind is your friend
Matt
 
Old January 24th, 2005, 03:53 AM
Registered User
 
Join Date: Dec 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks to all. i had used the replace function before entering into the database. it solves my problem. thanks to all
Quote:
quote:Originally posted by nkramanmca
 hi

advance thanks. in asp if i give the enter button in the text area it stores in the database as a pipe symbol. while retrieving that record i can't get the data into that text area. how i can eliminate this problem. Thanks

Kalyanaraman Narayanan
Kalyanaraman Narayanan





Similar Threads
Thread Thread Starter Forum Replies Last Post
saving text from ASP textarea to Access arabuafef Access ASP 3 December 26th, 2006 04:09 AM
HTML tags is not working in textarea in ASP.net suman9730 General .NET 1 May 23rd, 2006 04:48 AM
ASP and textarea tag chmosiii Classic ASP Professional 2 February 21st, 2005 12:45 AM
display vbCrLf's from textarea to textarea mat41 Classic ASP Basics 8 June 10th, 2004 12:19 AM
ASP: Textarea Problem when updating DB seala Access ASP 1 June 13th, 2003 12:35 PM





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