Re: Preserving \r\n in Textarea

From: Date: Fri, 30 Jun 2000 03:09:18 +0000
Subject: Re: Preserving \r\n in Textarea
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-3944@lists.php.net to get a copy of this message
On 29 Jun, Clarence Kwei wrote: > > Is there a function that will preserve newline (\n) and/or carriage returns > (\r) so when the text is pulled from a database is displayed in a "textarea" > form, the lines break properly? > > Right now, they get converted in to spaces and I'm not sure how to preserve > them. Any help would be greatly appreciated. > > Thanks! > > -- > > Clarence > > -> clarencek@ifurnishing.com Well, in theory if you have put linefeeds in the database you should get them back again unchanged. But what might be happening is that the input textarea is doing a 'virtual' wrap on text entered, but actually passing it on as a single line. There are/were(?) some attributes for TEXTAREA like WRAP=PHYSICAL, WRAP=VIRTUAL (and maybe another) which help to control this behaviour. Threre may have been some incompatibilities as to how different browsers respected those attributes - surprise. Cheers -- David Robley | WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet | http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA

« previous php.general (#3944) next »