Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

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

You are here: irt.org | FAQ | JavaScript | Form | 3.3 | Q195 [ previous next ]

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>

©2018 Martin Webb