Jump to content

Recommended Posts

This should be default behavior. If, you want it to show on an HTML page, you will need to use nl2br on the field when you display it (do not do it before you insert it into a database, better to keep it as the \n character). IE:

 

$text = isset($_POST['textareaname'])?$_POST['textareaname']:'';

echo nl2br($text); 

 

Should display the linebreaks properly.

 

EDIT:

Just saw that this was posted in the HTML section. Since it is HTML, I think you would need to use JavaScript to conver the \n (linebreak character) to <br />. Since I do not know Javascript I cannot offer much help then to set you on the right direction. If you are using PHP, the above advice will work.

 

EDIT:EDIT:

If you want to view it and do not care about formatting, encasing the value in a <pre></pre>  tags will display the line breaks properly as well.

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.