[SOLVED] Formbuilder textarea and newlines (linebreaks)

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
180michael
Forum Members
Forum Members
Posts: 27
Joined: Fri Dec 26, 2008 9:29 pm

[SOLVED] Formbuilder textarea and newlines (linebreaks)

Post by 180michael »

I recently found out that presently Formbuilder's textareas do not support newlines / linebreaks. To reduplicate just create a form with a textarea, type in:

Line 1
Line 2
Line 3

and see in the email sent by the form "Line 1 Line 2 Line 3".

Does anyone know the easiest way to patch this with say nl2br? I'm thinking a UTD would be best but I'm not entirely sure how that would be done. Either way, there's really no excuse for not supporting this.

CMSMS 1.5.3
Formbuilder 0.5.11
Last edited by 180michael on Wed Jun 24, 2009 5:19 pm, edited 1 time in total.
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: Formbuilder textarea and newlines (linebreaks)

Post by Rolf »

hi 180michel,

You can use WYSIWYG in the textareas in Formbuilder 0.5.11
But also look here: http://forum.cmsmadesimple.org/index.ph ... 510.0.html

Grtz. Rolf  :)
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
180michael
Forum Members
Forum Members
Posts: 27
Joined: Fri Dec 26, 2008 9:29 pm

Re: Formbuilder textarea and newlines (linebreaks)

Post by 180michael »

Actually, I don't want a wysiwyg on the front end, just a plain text field like the majority of all sites' contact forms. I've written quite a few form handling programs in my day and I would always use nl2br() to add breaks where needed for html emails. Is there any uplgrade-friendly way to add this to FormBuilder's handling of textarea variables (a.k.a. not editing the source files)? Thanks!
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Formbuilder textarea and newlines (linebreaks)

Post by Dr.CSS »

How would it know to put the nl2br() in the text area info?...
180michael
Forum Members
Forum Members
Posts: 27
Joined: Fri Dec 26, 2008 9:29 pm

Re: Formbuilder textarea and newlines (linebreaks)

Post by 180michael »

I'm thinking that it could use this for outputting, so the engine wouldn't store the variable in the database with rendered html but before sending it in an html email or printing on a page it could run it through the function (along with htmlentities()) so that the text is printed as it was typed. This is for both the confirmation email and the owner receiving the email.

Thinking from the end user's perspective, you expect for your text to appear as you type it but a formatting toolbar is overkill for a simple contact form. If you go to any professionally done site, this is the case—no bloated toolbars, just simple textareas that render as typed.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Formbuilder textarea and newlines (linebreaks)

Post by Dr.CSS »

Not sure you answered my question, but you are welcome to add this as a feature request or build your own module as it sounds like you are capable of doing so...
Ast
New Member
New Member
Posts: 2
Joined: Wed Jun 10, 2009 4:29 am

Re: Formbuilder textarea and newlines (linebreaks)

Post by Ast »

Any luck with this 180michael?
geeves
Forum Members
Forum Members
Posts: 114
Joined: Wed Dec 03, 2008 4:56 am

Re: Formbuilder textarea and newlines (linebreaks)

Post by geeves »

I posted this exact question here and still no answer to it:
http://forum.cmsmadesimple.org/index.ph ... 408.0.html

I'd say this was a pretty fundamental request to be able to preserve simple things like line breaks in form submissions.

Can ANYONE please give us a definitive answer on this one?

Cheers
Ara Garabedian
Multimedia Designer / Developer
http://ara.ifky.com.au
180michael
Forum Members
Forum Members
Posts: 27
Joined: Fri Dec 26, 2008 9:29 pm

Re: Formbuilder textarea and newlines (linebreaks)

Post by 180michael »

Hello everyone.

I've been coding some cakephp projects for the last month instead or so instead of using cmsms so I haven't gotten around to fixing this. As soon as I can I'll take a look at the code. I'm certain it can be done. Seems basic to me.
geeves
Forum Members
Forum Members
Posts: 114
Joined: Wed Dec 03, 2008 4:56 am

Re: Formbuilder textarea and newlines (linebreaks)

Post by geeves »

Can someone PLEASE answer this one. It is driving me insane.

If no one knows how to fix this, can you at least tell me which module file does the processing and emailing of forms in FormBuilder.

Thanks
Ara Garabedian
Multimedia Designer / Developer
http://ara.ifky.com.au
vilkis

Re: Formbuilder textarea and newlines (linebreaks)

Post by vilkis »

Hi,
for textarea fields use {$fld_XXX|nl2br} in email template.
vilkis
geeves
Forum Members
Forum Members
Posts: 114
Joined: Wed Dec 03, 2008 4:56 am

Re: Formbuilder textarea and newlines (linebreaks)

Post by geeves »

Thank you so much vilkis. I was horrified at how simple it turned out to be.

180michael can you mark this topic as SOLVED please.
Ara Garabedian
Multimedia Designer / Developer
http://ara.ifky.com.au
180michael
Forum Members
Forum Members
Posts: 27
Joined: Fri Dec 26, 2008 9:29 pm

Re: Formbuilder textarea and newlines (linebreaks)

Post by 180michael »

Never thought to just look at the smarty documentation. Duh! Thank you!
vilkis

Re: [SOLVED] Formbuilder textarea and newlines (linebreaks)

Post by vilkis »

You are welcome.

vilkis
Post Reply

Return to “Modules/Add-Ons”