Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q195 When creating a textarea in a script how can I make sure each line of text appears on its own line?

irt.org | Knowledge Base | JavaScript | Form 3.3 | Q195 [ previous next ]

Q195 When creating a textarea in a script how can I make sure each line of text appears on its own line?

Place a \n at the end of each line:

<SCRIPT LANGUAGE="JavaScript"><!--
message = '<form><TEXTAREA NAME="body" ROWS=7 COLS=27>'+ 
          'This is supposed to be written on line 1\n'+
          'This is supposed to be written on line 2 of the text area\n'+
          'etc...\n'+
          '<\/TEXTAREA><\/form>'

document.write(message);
//--></SCRIPT>

Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.