[SOLVED] Formbuilder textarea and newlines (linebreaks)
-
- Forum Members
- Posts: 27
- Joined: Fri Dec 26, 2008 9:29 pm
[SOLVED] Formbuilder textarea and newlines (linebreaks)
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
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.
Re: Formbuilder textarea and newlines (linebreaks)
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
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
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
-
- Forum Members
- Posts: 27
- Joined: Fri Dec 26, 2008 9:29 pm
Re: Formbuilder textarea and newlines (linebreaks)
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!
Re: Formbuilder textarea and newlines (linebreaks)
How would it know to put the nl2br() in the text area info?...
-
- Forum Members
- Posts: 27
- Joined: Fri Dec 26, 2008 9:29 pm
Re: Formbuilder textarea and newlines (linebreaks)
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.
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.
Re: Formbuilder textarea and newlines (linebreaks)
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...
Re: Formbuilder textarea and newlines (linebreaks)
Any luck with this 180michael?
Re: Formbuilder textarea and newlines (linebreaks)
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
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
-
- Forum Members
- Posts: 27
- Joined: Fri Dec 26, 2008 9:29 pm
Re: Formbuilder textarea and newlines (linebreaks)
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.
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.
Re: Formbuilder textarea and newlines (linebreaks)
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
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
Re: Formbuilder textarea and newlines (linebreaks)
Hi,
for textarea fields use {$fld_XXX|nl2br} in email template.
vilkis
for textarea fields use {$fld_XXX|nl2br} in email template.
vilkis
Re: Formbuilder textarea and newlines (linebreaks)
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.
180michael can you mark this topic as SOLVED please.
-
- Forum Members
- Posts: 27
- Joined: Fri Dec 26, 2008 9:29 pm
Re: Formbuilder textarea and newlines (linebreaks)
Never thought to just look at the smarty documentation. Duh! Thank you!