Jump to content

How can i add a break space in a text area?


svgmx5

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.