Reputation: 185
I am using a textarea field to display the status of a form submission. The form itself allows the user to delete one or more images.
Currently the textarea is showing:
1234.pdf has been deleted. 5678.pdf has been deleted. (no line-breaks)
I'd like it to look like:
1234.pdf has been deleted.
5678.pdf has been deleted.
I've tried putting in <br/>
(which then shows the <br/>
in the text, but doesn't cause a line break) and I've tried Environment.NewLine, which seems to get ignored and ends up showing the first example above.
What am I doing wrong?
Upvotes: 0
Views: 1590
Reputation: 1638
Both:
<textarea rows="10" cols="30">
1234.pdf has been deleted.
5678.pdf has been deleted.
</textarea>
and
<textarea rows="10" cols="30">
1234.pdf has been deleted. 5678.pdf has been deleted.
</textarea>
should work. So if you write output from PHP for example just put \n or
at the end of every string and will work. If you use C# or vb.net use (char)10 for C# or chr(10) for .vb.
Upvotes: 1
Reputation: 1462
Try using 

<textarea rows="10" cols="30">
I'm playing 
 in the garden.
</textarea>
Upvotes: 1
Reputation: 325
Use line feed and carriage return characters
line 1 line 2
the
should make a line break
Proof this works: JSFiddle
Upvotes: 3