Recently, I encountered a problem about whether data can be transferred to Textrea for Row-based storage. Here I summarize whether a data transfer to Textrea for Row-based storage, here is a summary:
Problem description:
For example, if you want to get data to a TextArea, such as aaa bbb, and want to store the text in TextArea by row, instead of displaying row-based storage (the so-called real row-based storage means that the data of the TextArea is then post to the Textarea of another page, which is still stored by row)
Solution 1:
At the beginning, when submitting data, the format is AAA.
BBB, but this is a line feed. In fact, it is not actually stored by row in TextArea, because AAABBB is displayed when it is submitted to another TextArea, rather than line feed, therefore, only display and store by row
Basic Problem knowledge:
The line feed in HTML is
While the line feed of TextArea is/n.
Solution 2:
Submit data before using Javascript
And/n replace
Submitted
As Separator
After submission
The Code is as follows:
Script
// Press ENTER for line breaks
Var haha = document. getElementById ("SendTextArea"). value;
Haha = haha. replace ('
','/N ');
Document. getElementById ("SendTextArea"). value = haha;
Script
This is OK!