Jump to content

[SOLVED] I need help with a textarea


kevincro

Recommended Posts

I have a form that contains a textarea, the form is processed using php and is saved into a MySQL database field.  The DB field is a text area.  The problem that I have is no matter how the user enters the info, it is saved without any paragraphs or line breaks.  How do I over come this.  Thank you

KC

Link to comment
Share on other sites

No, when a user enters data into a textarea, linebreaks are transmitted as the "\n" characters. When this data is displayed in a browser, the browser does not interpret the "\n" to be a line break, so you need to use the nl2br() function to add the <br> tag after each "\n" character.

 

Ken

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.