Skip to main content
Participant
February 18, 2012
Question

Textarea wrap issue

  • February 18, 2012
  • 1 reply
  • 544 views

I working on a .php file. In the file is a form. In the form is a text area (textarea).

I'm trying to have seperate paragraphs instead of one single paragraph. When I type in the textarea I press enter twice to seperate the paragraphs from each other but when I click the submit button the content just shows up as one single paragraph.

I have tried wrap="hard" and soft and off, but it is not working. Here is the line of code:

<textarea name="comment" cols="55" rows="10" wrap="hard" id="comment"></textarea>

am I applying it wrong? is there another way to achieve the seperate paragraphs?

Thank you

This topic has been closed for replies.

1 reply

Participating Frequently
February 19, 2012

Pressing 'Enter' creates a carriage return (type dependent on the OS). HTML compresses all whitespace into a single character, so you can't use a carriage return to separate paragraphs. You'll need to convert the cr to a <p> or <br>. Do a web search and you'll find lots of examples.