Re: <textarea>

by gchurchman(at)medseek.com (Gary Churchman)

 Date:  Mon, 31 Jan 2000 10:34:53 -0800
 To:  <hwg-techniques(at)hwg.org>
  todo: View Thread, Original
Iztok,

I think I understand the problem you describe.  I use ColdFusion so the
syntax is no doubt very different from what you are using.  I won't try to
spell out any exact code for that reason.  The essence of the solution is in
two parts.  First make sure the properties for the textarea are set to
"wrap=[soft or virtual]".  That will assure the text will display correctly
no matter what size the browser is stretched to.  Second, the virtual wrap
adds carriage returns to the text, and it is stored in the database that
way.  When it is replayed in the textarea, those carriage returns are
doubled because the soft wrap adds another carriage return.

What you need to do is strip out the carriage returns before the text is
saved to the database,  Then the next time the text is sent to the textarea,
there will only be one set of carriage returns, and the extra spaces will no
longer bother you.

BTW in ColdFusion the method is to use a function call in the SQL that posts
the text to the database, and goes something like this:
#replace([variable name], "chr(13)", "", "all")#

This calls the carriage return "chr(13)".

HTH
Gary Churchman
Director, Production and Design
MedSeek
gchurchman(at)medseek.com

-----Original Message-----
From: Iztok Polanic <iztokp(at)amis.net>
To: hwg-techniques(at)hwg.org <hwg-techniques(at)hwg.org>
Date: Friday, January 28, 2000 11:36 AM
Subject: <textarea>


>Hy!
>
>I'm using <textarea> to save something into database. But when I try to
>output it into the same <textarea> I get all of the sudden some spaces
which
>weren't there when I save the same text. Is there a way how to prevent this
>from happening?
>
>Any ideas?
>
>Bye,
>
>Iztok
>
>
>

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA