Hi,
Im writing a script that uses text boxes that users can submit text in.
The problem is, when you push enter (for a new line) in the text box, what appears as a new line in the text box gets sent to PHP as a space.
How do you differenciate between spaces and new lines? I dont want the user to have to type in /r/n or push a button each time they want to go to the next line; it should be like it is here and on other forums where the enter key
moves you to the next line.
How do I work around this?
Thanks
New line in a text box?
Moderator: General Moderators
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: New line in a text box?
When displaying the content in html, pass it through nl2br()
Re: New line in a text box?
Thanks that did it 