Format Input Preserved

[Total: 0    Average: 0/5]

This script takes input from the user (until the cancel button is used) and puts it onto the screen.

Body Code:

<script>
var _data="nothing";
while (_data)
{
  _data = prompt("Enter data");
  if(_data=="undefined")_data=null;
  if(_data==0)_data=null;
  if(_data)document.write(_data);
}
</script>

<HR>

<form name=f1>
<textarea name="t1" rows=10 cols=10 >lot of
text 
with
returns in
it</textarea>
</form>

<HR>
<script>
var _msg1 = document.f1.t1.value;
var _msg2 = _msg1.split(/n/);
for(var i=0;i<_msg2.length;i++)
{
  document.write(_msg2[i]+"<BR>");
}
</script>

Times Viewed: 3

Leave a Reply

Your email address will not be published. Required fields are marked *