Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

filling a textarea from code

Status
Not open for further replies.

MaxZak

Programmer
Oct 5, 2001
116
IT
I'm trying to fill a textarea tag from JavaScript: I'm assigning to the innerHTML property a string, but i'm not able to let the text go to a new line. I've tried with a &quot;\n&quot; inside my string, but it doesn't work (maybe because I modified the innerHTML), I've tried with a&quot;<br/>&quot; inside my string, but still doesn't work... how can I do that? It seems to work with the innerText property, but that property isn't recognized from Netscape (isn't it?)

Thanks.
Max
 
I have this same problem and document.notes.notesinput.value = &quot;my notes&quot;
does not work, is there another way
 
str = &quot;one \n\r two \n\r three.&quot;;
document.Formname.fieldName.value = str;

use \n\r but \r by itself may be enough.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top