Editing in a text area field

From: Date: Fri, 09 Jan 2009 13:12:08 +0000
Subject: Editing in a text area field
Groups: php.general 
Request: Send a blank email to php-general+get-285821@lists.php.net to get a copy of this message
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 Stephen

« previous php.general (#285821) next »