"cooldaddy" <> wrote:
> I've got a problem with a form's textarea. My script reads out the form
> paramaters, and stores the content of the textarea into a string named
> $line; To make sure all \n's in the string are replaced by <br> I use:
> $line =~ s/\n/<br>/gs; Then I store this into a database.
>
> In an other script I retreive these values and print them out.
> It prints ok, however.. if the text in the textarea is wrapped (if the
> user types all the way to the end of the textarea, and it continues
> automaticly at the next line), the output to the screen is a lot
> different then what was put in. How can I make it so that the output
> looks the same way as the input ?
If you don't monkey with the "\n"s and you display the data in a textarea
control of the same dimensions as the one used in the input, then it will
look like the input did. If you display the output as plain html not in a
form element, then you can't generally make it look like the input did,
because the input was in a textarea and output will not be.
If you want to word-wrap the output to a certain line length, then word
wrap it. That has nothing to do with text areas or forms and little to do
with html. Maybe Text::Wrap would do.
Xho
--
--------------------
http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB