This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 2

Email text on one line


  1. reprocessor
    Member

    Hi Yuniar,

    Long time no speak!

    I have a wee problem. One of the main fields on our forms has paragraph text. When we get our email from the system and open this up in our email software, the text from this field appears all in one line. Is there any way this can be shrunk so that it can appear on multiple lines? It's imperative that this information is printable and easy to read. If so can you let me know how to do this? If you like I can send you the email in question so that you can have a look. I've still got your email address so I can forward it on that way if you like.

    I look forward to hearing from you shortly.

    With kindest regards,

    Phil Reid

    Posted 15 years ago #
  2. yuniar

    Hi Phil,

    Hmm..what email client do you use? Also, are you using the standard HTML email or the plain text option? It should have been automatically wordwrapped.

    Try to edit your includes/helper-functions.php file, search around line 342:

    if($data['element_type'] == 'textarea'){
    	$data['value'] = nl2br($data['value']);
    }

    change it to become:

    if($data['element_type'] == 'textarea'){
    	$data['value'] = wordwrap($data['value'],20,"<br/> \n",true);
    }

    that would force wordwrapping into your paragraph field to 20 characters.


    MachForm Founder

    Posted 15 years ago #
  3. reprocessor
    Member

    Thanks for that Yuniar. We've been a bit stupid though!!! When my colleague tested the form he had 'TestTestTestTest...' in loads of times - of course, without spaces it's going to push the email out of the view pane in the email client. We ran another test with a couple of paragraphs of lorem ipsum and it worked no problem at all.

    Thanks once again for your timely reply and i'll keep this nugget of code handy - just in case we need to use it in the future.

    With kindest regards,

    Phil

    Posted 15 years ago #
  4. Anonymous
    Unregistered

    does this fix the email or the actual form element? Because my text area on the form is still one line and I was hoping to have it multi-line because it looks really ugly otherwise...

    Posted 15 years ago #
  5. yuniar

    masterstanf2k, what version of MachForm are you currently using?
    check your changelog.txt file at the bottom.

    The latest version already fixed this awhile ago.


    MachForm Founder

    Posted 15 years ago #

RSS feed for this topic

Reply