简体   繁体   中英

Preserve textarea line breaks via javascript

I'm looking for a piece of script that will convert a user's textarea line breaks into html on a form submission output so that formatting is preserved in our notification emails.

At the moment I have a couple of fields that require reasonably detailed answers and after submission these come through as one big chunk of text with no line breaks.

Any help would be much appreciated,

Oli

Managed to get to the bottom of this. Our CMS had a shortcode modifier to convert new lines into line breaks.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM