HTML - Newline and carriage return within textarea

on Tuesday, 25 March 2014
This post helped me solve a problem today that kept me puzzling for an good half hour. I was fiddling with the newline as I had to get the textarea to recognize the newline. It happends to be, to my unknowledge, that a textarea doesn't automaticly take /r/n into account. Specifcally those two in combination.

The first approved answer happened to be my solve. My journey towards that answer costed me an hour of research into why that is. I was loading my content out of a database with PHP and this dazzled me at first as when I printed the text, it would nicely make a line break. Yet, whenever I entered that very bit of code into a textarea, it didn't.

Another experience richer and more knowledgable. I used preg_replace() to convert "/r/n" into "
". I'll post the actual snippet later in this post.


Post a Comment