Recently I encountered a problem about whether data can be stored row by row when transferred to Textrea. Here is a summary:
Problem description:
For example, get data into a TextArea, such as "AAA BBB", I want to store this text in the TextArea in rows, instead of displaying it and storing it in rows (the so-called true storage in rows means, then post the data of this TextArea to the Textarea of another page or in rows) Storage)
Problem Solution 1:
When the data was submitted at the beginning, the format was AAA
BBB, but this showed line breaks. In fact, it was not really stored by lines in TextArea. Because when it is submitted to another TextArea at this time, it will display AAABBB instead of line breaks, so it will only display the storage by lines
Basic knowledge of the problem:
Line breaks in HTML are
, and the line break of TextArea is /n
Problem Solution 2:
Submit the data first and then use Javascript to replace
and /n
It is still when submitting
as delimiter
and then after submission