Form Textareas...
Posted: Mon Feb 16, 2009 4:45 am
I am in the process of building a comment system for my website, however I have come across a problem.
I can get the comments displaying correctly when they are submitted to the database, but when I try to echo them out in the textarea they do not display properly. I will try and explain it below...
Say if the user typed in the textarea the following...
Hello, I do like this...
...My name is bob.
But if the user get's an error when submitting the form, it will not display like that when it is echoed out again, it will be something like this...
Hello, I do like this...\n\n\n\r\n\n\n\r...My Name is bob.
It would display all in one block. So how would I be able to echo it out again just as the user typed it in the first place?
I have already tried using nl2br() and also stripslashes().
Thanks in advance.
I can get the comments displaying correctly when they are submitted to the database, but when I try to echo them out in the textarea they do not display properly. I will try and explain it below...
Say if the user typed in the textarea the following...
Hello, I do like this...
...My name is bob.
But if the user get's an error when submitting the form, it will not display like that when it is echoed out again, it will be something like this...
Hello, I do like this...\n\n\n\r\n\n\n\r...My Name is bob.
It would display all in one block. So how would I be able to echo it out again just as the user typed it in the first place?
I have already tried using nl2br() and also stripslashes().
Thanks in advance.