Recently I encountered a question of whether data can be stored on a row in Textrea. Let me summarize it here:
Problem description:
For example, get data into a TextArea, such as AAA BBB, you want to store this text in TextArea according to the line, instead of displaying it as a line (the so-called real storage according to the line is to post the TextArea data to another page, and still store it according to the line)
Problem Solving 1:
At the beginning, the format was AAA<BR />BBB, but this shows a new line. In fact, it is not really stored by line in TextArea, because when submitted to another TextArea, it shows AAABBB, not a new line, so it is just displaying a new line.
Basics of the problem:
The line break in HTML is <BR />, while the line break in TextArea is /n
Problem Solving 2:
Submit the data first and then replace <BR /> and /n using Javascript
When submitting it, it is still <BR /> as a separator
Then after the submission is complete
Copy the code