EasyCFM.COM ColdFusion Forums / Coding Help! / Multiple line to be a single line

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: Multiple line to be a single line

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

ctman10
04-23-2007 @ 7:47 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 12
Joined: Dec 2005

hai,

how to make multiple line to be a single line. i try to use wrap = "hard" from textarea but it seems doesnt work. and also i try using <cfset test = replace (#form.input#,chr(13),\n). only the first line work. eg:

paraghraph1

paraghraph2
paraghraph3

Thank you.


ct

CJ
04-23-2007 @ 8:09 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Administrator
Posts: 4262
Joined: Oct 2002

replace() has an optional 4th attribute for scope.  by default it will only replace the first instance (which you say works).

if you want all instances, do:

replace(form.input, chr(13), \n, 'all')

altho i'm not entirely sure what you're trying to do.  you want multiple lines to be a single line?  you want to remove line breaks?

-CJ-
@ #coldfusion/DALNet
http://charlie.griefer.com

Teachers open the door. You enter by yourself.
—Chinese Proverb

ctman10
04-23-2007 @ 8:37 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 12
Joined: Dec 2005

thank you for the code

i used the code but the output become

paragraph1\n
\n
paragraph2

actually i want the output to be paragraph1 paragraph2 paragraph3 .....


thank you.

ct

CJ
04-24-2007 @ 1:56 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Administrator
Posts: 4262
Joined: Oct 2002

have you tried wrap="virtual" in the <textarea> tag?

if that doesn't work, try:

replace(form.input, chr(13)&chr(10), ' ', 'all')

-CJ-
@ #coldfusion/DALNet
http://charlie.griefer.com

Teachers open the door. You enter by yourself.
—Chinese Proverb

ctman10
04-24-2007 @ 4:55 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 12
Joined: Dec 2005

Thank you. it's works.

ct

Sponsored By...
iOpenSoft, LLC is a Houston, Texas Advanced Technology Studio Specializing in Web Design, Web Development, iPhone App Development and Android App Development.