Page 1 of 1

Keeping Formating from textarea's

Posted: Thu May 16, 2002 5:42 pm
by digitalwolf
I am having trouble keeping the formatting of information entered into a textarea in my form.
I have found some help keeping the lines breaks at the appropriate place but I need help keeping
the spacing. As in if some puts in three or four spaces instead of one and keeping that fromat.
This is driving me crezy. Crazy designers keep coming up with annoyting problems for me
to solve.

Thanks for any help

Posted: Thu May 16, 2002 6:00 pm
by hob_goblin
a few suggestions, they might not work but its worth a try

<pre>...</pre> was designed to prevent formatting...but it doesnt escape html...

perhaps

<pre><textarea>stuff </textarea></pre> would work?

also...no clue but do &nbsp;'s work in textareas?

Posted: Thu May 16, 2002 6:14 pm
by jason
Have you looked at nl2br()

Posted: Thu May 16, 2002 7:00 pm
by hob_goblin
if you're saying that the script takes out the the spaces try

$foo = ereg_replace(" ", "&nbsp;", $foo);
$foo = nl2br($foo); // i dont use this so it might be wrong


you might also want to look into
wordwrap()