PDA

View Full Version : Need help with using html in textarea


Antoniohawk
11-03-2002, 04:25 AM
I have the following in my javascript:


fletchoutput.value = ''+regS+' Regular Shortbows<br>'+regL+' Regular Longbows<br>'+oakS+' Oak Shortbows<br>'+oakL+' Oak Longbows<br>';
...

You have to fletch/string<br>
<textareaname="fletchoutput"></textarea>


after the script runs, the following appears in the textarea:

50 Regular Shortbows<br>25 Regular Longbows<br>15.151515151515152 Oak Shortbows<br>10 Oak Longbows<br>

the '<br>' appears instead of going to the next line. Why does it do that, and what can i do?

joh6nn
11-03-2002, 06:28 AM
it does that, because text areas tag plain text only, and <br> is html, not plain text. replace them with \n, and you should be fine.

Antoniohawk
11-03-2002, 06:50 AM
thx alot i will try that out