<textarea> new line

Hi,

How can I make a new line in a textarea?

I have created these but neither work.


<textarea name="textarea">test<br>test2</textarea>

<textarea name="textarea">test\
test2</textarea>

Can someone please help?

Thanks,

Al

<textarea name="textarea">test
test2</textarea>

ok,

That works, but I need it to accept values such as <br> or
to create the newline.

Can the field be made to except html code and proces it?

Thanks,

Al

Not unless you use entities or a sever side script.

I have

<textarea name="textarea">test\
test2<br>test3</textarea>

But that doesn’t work make the line break with the <br>.

:frowning:

Al

Textarea is literally that. The values you put in there will be shown. If you ‘forget’ to end the tag, the rest of your HTML document will be displayed in the textarea.

I’m not too sure why you’d want your users to type in “<br>” or "
" but if you use a server side script you could make it so anytime they pressed enter (to create a new line) your script would interpret that as “<br>”.

Adam

If you’re trying to format text that already appears in a textarea then you should probably rethink what you’re trying to do with it.

<textarea>foo&[b][/b]#10;bar</textarea>