MrFish Posted October 23, 2009 Share Posted October 23, 2009 I have a textfield that is used to submit news content to my site. It excepts html (only the admin can use it) and I'm writing bbcode for it but when I hit the enter key to create a newline or space it doesn't save and the text will all site in one line when it is submitted.What I write- This is a textfield.I hit enter to create a new line.I hit enter twice to create a space. What it submits as- This is a textfield.I hit enter to create a new line.I hit enter twice to create a spaceHow can I fix this? Link to comment Share on other sites More sharing options...
jlhaslip Posted October 23, 2009 Share Posted October 23, 2009 nl2br() in php or search the textarea and replace the newline (\r\n) with a <br /> Link to comment Share on other sites More sharing options...
MrFish Posted October 23, 2009 Author Share Posted October 23, 2009 nl2br() in php or search the textarea and replace the newline (\r\n) with a <br />I didn't know textareas held \r and \n information when you hit enter. Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.