...

View Full Version : Adding <br /> when I press enter in form?



javanoobie9
02-24-2008, 05:54 PM
I'm using php. I have a html form and want to automatically add <br /> when I preses enter. How can I do that?

VIPStephan
02-24-2008, 06:42 PM
How can I do that?

With PHP, not with HTML. You may be looking for http://de2.php.net/manual/en/function.nl2br.php ?

javanoobie9
02-24-2008, 08:43 PM
With PHP, not with HTML. You may be looking for http://de2.php.net/manual/en/function.nl2br.php ?

So how can I get that to work with the form? I have a php page with a html form. How can I make that so when a user presses enter in the form it'll return a new line instead of a space?

_Aerospace_Eng_
02-24-2008, 08:46 PM
You don't. On the server side you store the text as normal. Then when you want to display it you run the text through the nl2br function. Learn to read the manual.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum