MidOhioIT Posted January 24, 2010 Share Posted January 24, 2010 I have a form that is being used for the start of a newsletter for my client to fill in. The form has a textbox that is being used for the subject and a textarea that I am using for the body of the email. The problem that I am having is when you type in the textarea and you hit enter to start a new paragraph, the code just reads everything in the textarea and does not start the new line like it appears it does in the textarea. Is there an easy way to read the variable and capture the fact that the enter button was hit to do a "<br>" for a new line? Quote Link to comment Share on other sites More sharing options...
teamatomic Posted January 24, 2010 Share Posted January 24, 2010 This is what you want, its what I use on my forms. http://www.dynamicdrive.com/dynamicindex16/disableenter.htm HTH Teamatomic Quote Link to comment Share on other sites More sharing options...
MidOhioIT Posted January 24, 2010 Author Share Posted January 24, 2010 Thanks, but not exactly what I was saying. Let me try to explain differently. On the text area when I type the following: this is my first paragraph... This is my second paragraph... This is my thrid paragraph... I get this result in my email: this is my first paragraph... This is my second paragraph... This is my thrid paragraph... When I expect line breaks.. Quote Link to comment Share on other sites More sharing options...
MidOhioIT Posted January 24, 2010 Author Share Posted January 24, 2010 i figured it out.. you have to do the following function: $content=nl2br($_POST['content']); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.