Cognito Forms – Line Breaks in Multiple-Line Textbox Not Showing in Email Notifications

cognito-forms

Line-breaks in multiple line textbox will show as a single line in email notifications. Is there a workaround for this?

Best Answer

I am a developer for Cognito Forms.

The same issue occurs when including the field in a content area on the form or the confirmation page. I will cover some of the possible solutions to this. Please comment on this answer to provide feedback.

  1. The text captured from a multiple line textbox contains line breaks, but HTML just treats these as spaces, so when shown in a content field or HTML email message, the line breaks are ignored.

  2. The line breaks cannot be converted into HTML
    tags when edited, as this would mess up other usages of the data, like exports to Excel, which rely on the data existing as entered. Also, we have logic in place to prevent HTML and script injection attacks that would remove this content anyway, which is in place to protect our customers.

  3. We could convert line breaks to
    tags when building email messages and content areas on the form for these fields. This would leave the data intact. However, this would only apply to line breaks (no other formatting) and also would not be something that could be turned off.

  4. We could also add optional support for markdown (similar to what I am typing now) and support both line breaks and a variety of limited syntax formatting. The advantage to this is it would be an option that could be turned off, but is not obvious to most users.

Again, definitely an issue with no workaround at present, but hopefully this provides some perspective on the issues and possible solutions. Please let us know your thoughts.