We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18817 ☆ A M B ☆
    • 205 Posts
    Using eForm how would one go about creating textareas that retain line breaks when that submission comes through via email.

    Currently, users who are writing lengthy comments in a textarea, with line breaks, come as a single paragraph of text in the emails.

    A little research on my end and I found the nl2br() function, but I’m told eform may not support this and eform also doesn’t play with javascript telling it what to do.

    Your help is appreciated. huh
      Sal Baldovinos
      SEO & DIGITAL MARKETING

      ARIEL DIGITAL | Maximize Your Potential
      www.arieldigitalmarketing.com
      • 26016
      • 561 Posts
      Hi Mayhem,
      That’s an interesting question. I actually think you’re on the right track... I don’t see a reason why you couldn’t set up your submit button with a function that would run on an "onclick" event. It would do a find/replace on the carriage returns and replace them with break tags or whatever, and then would submit the form when done. Eform wouldn’t be a bit the wiser, I’m quite sure.

      When coding the Javascript function, just be aware that different operating systems would have different carriage returns, I think, like Mac vs. Windows, so you’d need a bit of extra code for that.

      Good luck, Dave
        MODx and Wordpress development
        Linux, PHP 5.2, MySQL 5.0, Evo 1.05, Revo 2.08-pl, Firefox 4
        • 18817 ☆ A M B ☆
        • 205 Posts
        I’m going to chalk this up to Friday burnout

        solution: eform="Comment:html:1"
          Sal Baldovinos
          SEO & DIGITAL MARKETING

          ARIEL DIGITAL | Maximize Your Potential
          www.arieldigitalmarketing.com
          • 3749
          • 24,544 Posts
          I usually use lack of sleep as my excuse. wink
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting