Hey guys.
Just wanted to know if there is any way of preserving line / paragraph breaks entered in a text field in a FormBuilder form?
My client is complaining that the submission html template is too hard to read without the line breaks.
Cheers
how can I preserve line breaks in formbuilder submission
how can I preserve line breaks in formbuilder submission
Last edited by geeves on Fri Jun 05, 2009 6:18 am, edited 1 time in total.
Re: how can I preserve line breaks in formbuilder submission
bump, I would really like to know as well. I have tried playing around with the files but I don't have much experience with php.
- kittymcooper
- Forum Members
- Posts: 44
- Joined: Sat Aug 02, 2008 4:40 am
Re: how can I preserve line breaks in formbuilder submission
I had the same problem and the only solution I found was to use HTML template and replace the returns with br via a Smart command. This looks nicer anyway. This is the line I use in the message template for the message text which preserves line breaks:
to add an an extra blank line do both the CRand the LF
You also need to add the same line in the submission template to show the user his message with the line breaks.
Code: Select all
<strong>Message</strong>: {$message|regex_replace:"/[\n]/":"<br />"}<br />
Code: Select all
<strong>Message</strong>: {$message|regex_replace:"/[\n\r]/":"<br />"}<br />
Kitty Munson Cooper, web designer, programmer
- kittymcooper
- Forum Members
- Posts: 44
- Joined: Sat Aug 02, 2008 4:40 am
[solved] Re: how can I preserve line breaks in formbuilder submission
forgot the solved in the top line and meant to say a Smarty command - regex
Kitty Munson Cooper, web designer, programmer
-
- Forum Members
- Posts: 125
- Joined: Tue Nov 22, 2011 2:22 pm
Re: how can I preserve line breaks in formbuilder submission
Really old thread, but I thought I'd post the answer anyway, go to your form in the FormBuilder module, go down to the form fields section in the Main tab. Click on the edit Send to button. Once in there click on Advanced settings, then in the Email Template area paste your submission template code, this is mine:
And bob's your uncle, line breaks and a nicely laid out plain text email submission.
Code: Select all
Your Website Name Form Submission
Form Name: {$sub_form_name}
Date of Submission: {$sub_date}
Your server: {$sub_host}
IP address of person using form: {$sub_source_ip}
URL of page containing form: {$sub_url}
FormBuilder version: {$fb_version}
-------------------------------------------------
Name: {$your_name}
Email address: {$email_address}
Email address again: {$email_address_again}
Telephone Number: {$telephone_number}
Subject: {$subject}
Message: {$message}
Going up, woop, woop.
Re: how can I preserve line breaks in formbuilder submission
Sorry govicinity but that wasn't what they were looking for, when you fill out a text area field in forms like Message: {$message} it won't see line breaks, it just makes the text one long sentence so what they need is more along these lines...
Message: {$message|nl2br}
http://www.smarty.net/docsv2/en/languag ... .nl2br.tpl
Message: {$message|nl2br}
http://www.smarty.net/docsv2/en/languag ... .nl2br.tpl