MrFish Posted October 23, 2009 Report 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 Report Share Posted October 23, 2009 (edited) nl2br() in php or search the textarea and replace the newline (\r\n) with a <br /> Edited October 23, 2009 by jlhaslip Link to comment Share on other sites More sharing options...
MrFish Posted October 23, 2009 Author Report 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
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now