| ten3six |
02-01-2013 10:01 PM |
line breaks not working in textarea
I have searched and found no solution so...
I've got a textbox that I am changing to a textarea so that I can show multiple lines but my javascript is not showing the line breaks. I know that \n should work but the display seems to be just ignoring it, not printing it. Does anyone know what I'm doing wrong?
Here is my textarea
Code:
<table class="COPY">
<tr>
<td class="COPY">
<!--input type="text" value="" name="COPYINPUT" class="COPYINPUT" ID="COPYINPUT"-->
<input type="textarea" value="" name="COPYINPUT" class="COPYINPUT" ID="COPYINPUT">
</td>
</tr>
</table>
and here is the CSS for it...
Code:
.COPY
{
border:0px inset #F5F5F5;
background-color:#F5F5F5;
border-color: #F5F5F5;
color: #F5F5F5;
}
.COPYINPUT
{
border:2px inset #F5F5F5;
background-color:#F5F5F5;
border-color: #F5F5F5;
/*color: #F5F5F5;*/
height: 300px;
width: 200px;
text-align: left;
vertical-align: top;
overflow: visible;
}
and HERE is my javascript that isn't working
Code:
document.Finance.COPYINPUT.value=("First Line\nSecond Line\\nThird Line\n\nFourth Line\n\rFifth Line\r\nSixth Line<br>Seventh Line")
and this is what shows up in the textarea
First LineSecond Line\nThird LineFourth LineFifth LineSixth Line<br>Seventh Line
As you can see "\n" is treated like it's not even there. Nothing seems to work. What am I doing wrong?
|