Editting Text Area Content when rendering

Hey Guys… So… Using text area to gather input that will be then rendered into a paragraph. I understand it will render as a SINGLE paragraph and therefore ignore the line breaks applied in the text area.
Any ideas on how to navigate through issue?

This is not true. Any line breaks you add to the textarea will be preserved when you pull the value from the textarea with JS. How you insert the value back into the DOM can affect if line breaks are preserved (and how they are preserved).

Codepen: texarea test

You can use the above codepen I put together to test this for yourself. Be sure to have the browser’s console open so you can see exactly what is being pulled from the textarea’s value.

1 Like

Not quite though….
I’m rendering dynamically with EJS. Once I map through the database it catches each post and renders a single Paragraph.
Within that paragraph the line breaks are not respected.
(Tools/tech: nodeJS, EJS, Express, Lodash, mongoose)
I do appreciate the effort though

All of that stuff you mentioned is beside the point. I was only commenting on your assertion that line breaks will be ignored in a textarea. They aren’t. If the tools you are using are removing them then that is a separate issue.

If I misunderstood your original post and you weren’t talking about an actual <textarea> but something else, then I guess your post wasn’t quite clear enough for me to make that distinction.

We are talking about the same text area. Mine is just being rendered dynamically in a paragraph via EJS and I was being problem specific… I thank you for the effort and time you are putting.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.