0

I have a form and one of the fields is textarea

How do I send this data so that the new lines(\n) will be included and will be saved into the database?

yareyaredaze
  • 85
  • 2
  • 10

1 Answers1

0

Since I got it working, I'm just gonna answer my own question:

I got it working by using regex.

str.replace(/(?:\r\n|\r|\n)/g, '<br>') will do the thing.

from : https://stackoverflow.com/a/784547/15382725

yareyaredaze
  • 85
  • 2
  • 10