Skip to main content
Participant
March 4, 2009
Question

cfdocument problem with textarea linebreaks

  • March 4, 2009
  • 1 reply
  • 859 views
Hi,

I am using cfdocument to generate pdf. There are some <textarea> input type fields as well, and if the data of those textarea fields contains any linebreaks, then the generated pdf shows empty boxes.

Any help is appriciated. I am using CF 8.1.31
This topic has been closed for replies.

1 reply

Inspiring
March 6, 2009
before you use the textarea's value in cfdocument, replace all CR & LF
characters with <br />.

there are couple of cf functions you can use to do it:

replace(somestring, chr(10) & chr(13), "<br />", "all")
rereplace(somestring, "\r\n", "<br />", "all")
listchangedelims(somestring, "<br />", chr(10) & chr(13))

[cf representation of CR and LF chars is chr(10) and chr(13); \r and \n
are regexp character classes for CR and LF]

hth

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/