Forum Moderators: coopster

Message Too Old, No Replies

Text areas

how do you auto-format a textbox?

         

penguinpage

8:58 pm on Jun 10, 2003 (gmt 0)

10+ Year Member



I have a form that creates a .txt file that is included in other documents. My form looks something like this.

<body>
<form action="filemaker.php" method="post">
<textarea name="thedata"></textarea><input type="submit" value="add">
</form></body>

right now if i typed... between{}
{
hello
this is a

test
}
the file says
{hello this is a test}
when i use the echo command in a php file

how do I have it insert the <br> tags automatically into the .txt file so it maintains the full structure of the textbox?

eaden

9:04 pm on Jun 10, 2003 (gmt 0)

10+ Year Member



you can either use the nl2br() function, which will add <br>'s, or you can use a <pre> text here </pre> html tag, which will keep the linebreaks intact.

das_shark

5:08 pm on Jun 11, 2003 (gmt 0)



If you want to make formatted text from a textarea, you can also add wrap="hard"

e.g. <TEXTAREA name="q" rows="20" cols="140" wrap="hard" value="">

This will insert a hard break into the text you post to your form.