my usual preference is to save the info in the db as it's entered, and
apply any formatting when outputting only.

so i would do:

page1:

<cfquery name="addData">
     INSERT
     INTO yourTable (comments)
     VALUES ('#Form.comments#')
</cfquery>

===================================

page2:

<cfquery name="getData">
     SELECT comments
     FROM yourTable
</cfquery>

<cfoutput query="getData">
     #ReplaceList(getData.comments, "#Chr(10)#,#Chr(13)
#", "<br>")#
</cfoutput>


The length of your field is a red herring, shouldn't make any difference.
although for a field called comments, I'd usually prefer to use a memo
field (assuming they're going to enter more than 50 words or so)


Duncan Cumming
IT Manager

http://www.alienationdesign.co.uk
mailto:[EMAIL PROTECTED]
Tel: 0141 575 9700
Fax: 0141 575 9600

Creative solutions in a technical world

----------------------------------------------------------------------
Get your domain names online from:
http://www.alienationdomains.co.uk
Reseller options available!
----------------------------------------------------------------------
----------------------------------------------------------------------



                                                                                       
                                
                    "Lovelock,                                                         
                                
                    Richard J"               To:     "'[EMAIL PROTECTED]'" <[EMAIL 
PROTECTED]>     
                    <richard.lovelock        cc:                                       
                                
                    @cgey.com>               Subject:     RE: [ cf-dev ] Keeping text 
formatting                       
                                                                                       
                                
                    27/11/2003 15:41                                                   
                                
                    Please respond to                                                  
                                
                    dev                                                                
                                
                                                                                       
                                
                                                                                       
                                



Thanks Duncan

Made some progress....

I wasn't actually outputting the comments from the form page - I was
actuallly doing an insert of the comments in to the DB at the top of the
page then pulling back the info to check that the insert worked ok.

I was then using the info pulled back in the query from the DB to output to
the page...

IF - I use the replace chr(10) etc etc straight on the form field without
going to the DB first it works fine and my line feeds are accurate.

IF - I go to the DB first - the replace chr(10) doesn't work.

This would suggest that the info coming back from the DB is different from
that which comes direct from the form.

Perhaps I need to change the way this info is stored as I will be using a
page which calls the text from the DB to display all of these comments.

I am using Access 2000 and the field is defined as text, length 255??

_______________________________________________________
*  Regards,
                Richard Lovelock
Westminster City Council - Web Support
Cap Gemini Ernst & Young
Southbank
95 Wandsworth Road
London
SW8 2HG
(     0870 906 7482

_______________________________________________________


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: 27 November 2003 15:34
To: [EMAIL PROTECTED]
Subject: RE: [ cf-dev ] Keeping text formatting



<cfset newcomments = ReplaceList(getcomments.comments, "#Chr(10)#,#Chr(13)
#", "<br>")>


Duncan Cumming
IT Manager

http://www.alienationdesign.co.uk
mailto:[EMAIL PROTECTED]
Tel: 0141 575 9700
Fax: 0141 575 9600

Creative solutions in a technical world

----------------------------------------------------------------------
Get your domain names online from:
http://www.alienationdomains.co.uk
Reseller options available!
----------------------------------------------------------------------
----------------------------------------------------------------------




                    "Lovelock,

                    Richard J"               To:
"'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
                    <richard.lovelock        cc:

                    @cgey.com>               Subject:     RE: [ cf-dev ]
Keeping text formatting


                    27/11/2003 15:19

                    Please respond to

                    dev








can you put multiple replaces in the same replace function?

i tried chr(10) on its own (in place of the 13) and this made no difference

you can try it in the comments box here:
http://fclounge.cfdeveloper.co.uk/commentadd.cfm

_______________________________________________________
*  Regards,
                Richard Lovelock
Westminster City Council - Web Support
Cap Gemini Ernst & Young
Southbank
95 Wandsworth Road
London
SW8 2HG
(     0870 906 7482

_______________________________________________________


-----Original Message-----
From: Stephen Pope [mailto:[EMAIL PROTECTED]
Sent: 27 November 2003 15:14
To: [EMAIL PROTECTED]
Subject: RE: [ cf-dev ] Keeping text formatting


You might also try #chr(10)# as well as #chr(13)#

-----Original Message-----
From: Lovelock, Richard J [mailto:[EMAIL PROTECTED]
Sent: 27 November 2003 15:13
To: '[EMAIL PROTECTED]'
Subject: RE: [ cf-dev ] Keeping text formatting

cheers Robin.....

I tried:

                  <tr class="matchtableleft">
                    <td valign="top">Comments:</td>

<td>#replace("#getcomments.comments#",chr(13),"<br>","all")#</td>
                  </tr>

but it has made no difference?? have i got the syntax wrong?


_______________________________________________________
*  Regards,
                Richard Lovelock
Westminster City Council - Web Support
Cap Gemini Ernst & Young
Southbank
95 Wandsworth Road
London
SW8 2HG
(     0870 906 7482

_______________________________________________________


-----Original Message-----
From: Robin Griffiths [mailto:[EMAIL PROTECTED]
Sent: 27 November 2003 15:05
To: [EMAIL PROTECTED]
Subject: Re: [ cf-dev ] Keeping text formatting


2 options I can think of

1.  Use <pre></pre> tags to output exactly as the user input the code.
2.  User replace(myFieldContents,chr(13),"<br>","ALL")
  ----- Original Message -----
  From: Lovelock, Richard J
  To: 'cflist'
  Sent: Thursday, November 27, 2003 3:02 PM
  Subject: [ cf-dev ] Keeping text formatting


  I have a form with a multi line text box.

  On the action page - i am trying to display the contents of the text
box
but
  it is not formatting the line feeds/carriage returns properly.

  If the user enters some text and hits enter on the text box after
writing
  some text to start a new line and then enters more text, then the
resultant
  action page just puts 1 space between the two blocks of text instead
of
  starting the text on a new line.

  If the user enters some text then hits enter twice to effectively
start a
  new line of text with a line of gap in between the last one - then the
  action page renders this correctly.

  Do I need to use a certain function to uphold the carriage returns and
line
  feeds accurately? I had a look at HTMLEditFormat and HTMLCodeFormat
but
  neither upholds the formatting

  _______________________________________________________<?xml:namespace
  prefix = o ns = "urn:schemas-microsoft-com:office:office" />

  *  Regards,
                  Richard Lovelock

  Westminster City Council - Web Support
  Cap Gemini Ernst & Young
  Southbank
  95 Wandsworth Road
  London
  SW8 2HG

  (     0870 906 7482

  _______________________________________________________




  =======================================================
  This message contains information that may be privileged or
confidential
and is the property of the Cap Gemini Ernst & Young Group. It is
intended
only for the person to whom it is addressed. If you are not the intended
recipient, you are not authorised to read, print, retain, copy,
disseminate,
distribute, or use this message or any part thereof. If you receive this
message in error, please notify the sender immediately and delete all
copies
of this message.
  =======================================================



=======================================================
This message contains information that may be privileged or confidential
and is the property of the Cap Gemini Ernst & Young Group. It is
intended only for the person to whom it is addressed. If you are not the
intended recipient, you are not authorised to read, print, retain, copy,
disseminate, distribute, or use this message or any part thereof. If you
receive this message in error, please notify the sender immediately and
delete all copies of this message.
=======================================================


--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]


--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]


=======================================================
This message contains information that may be privileged or confidential
and is the property of the Cap Gemini Ernst & Young Group. It is intended
only for the person to whom it is addressed. If you are not the intended
recipient, you are not authorised to read, print, retain, copy,
disseminate, distribute, or use this message or any part thereof. If you
receive this message in error, please notify the sender immediately and
delete all copies of this message.
=======================================================


--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]






--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]


=======================================================
This message contains information that may be privileged or confidential
and is the property of the Cap Gemini Ernst & Young Group. It is intended
only for the person to whom it is addressed. If you are not the intended
recipient, you are not authorised to read, print, retain, copy,
disseminate, distribute, or use this message or any part thereof. If you
receive this message in error, please notify the sender immediately and
delete all copies of this message.
=======================================================


--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]






-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to