Retaining spaces in text fields

How do I go about retaining the spacing in text fields? Like if someone hit enter twice to seperate paragraphs. Sorry for all the questions today guys:beam: :blush:

i can’t remember how i’ve done it in the past, but one option is to split the string into an array at the line break. then loop through array and delete any blank entries. then echo each out with a <p> before and </p> after.

PHP? Use the nl2br() function.
http://us2.php.net/manual/en/function.nl2br.php

Or if you’re looking to break things up with different HTML tags (like the paragraph tag like bwh2 is talking about) use a regular expression and preg_replace() – or another regExp replace function. You can then replace all line feeds with something like </p><p>. You may need to add the start and end HTML tag to the start and end of the string as well.