Re: Editing in a text area field
| From: | Nathan Rixham | Date: | Fri, 09 Jan 2009 13:56:40 +0000 |
| Subject: | Re: Editing in a text area field | ||
| References: | 1 | Groups: | php.general php.general |
| Request: | Send a blank email to php-general+get-285826@lists.php.net to get a copy of this message | ||
Stephen wrote:
I have a form to accept free text in a textarea field. The entry is stored in a database. If the user enters: abc def ghi I want it to finally display like that. If they enter abc def ghi I want it to display with the line gaps. I use CSS so in the first case I would store as <p>abc<br />def<br />ghi</p> In the second <p>abc</p><p>def<p></p>ghi</p> I also have an edit form, that takes the data out of the database, and allows the user to change it, then update the database. Preparing the existing data before an edit is proving difficult. I have to strip the html and make it format properly in the form. Then put back html before saving again. I keep ending up with stray characters Has anyone done this? Is there a tutorial on the web somewhere? Thanks Stephenyou could always just use YUI rich text editor or tinymce on the client side