writing to a text file using execCommand('SaveAs')

wxdqz

New Member
I am using the followng code to save a textarea to an iframe named SaveFrame which then gets written to a text file:

var txt, crlf;
txt = '';
txt += formObj.emails.value;

SaveFrame.document.open("text/html","replace")
SaveFrame.document.write(txt)
SaveFrame.document.close()
SaveFrame.focus()
SaveFrame.document.execComman('SaveAs',true,'email.txt')

This works fine, however, my text area has carriage return in it that are diplaying very well in the text field :

<!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->

<!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->
etc...

when I write the iframe to my text file, I need the output to preserve these carriage return!! at the moment, the text file displays:

<!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->; <!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->;

Please help

Many thanks
 
Top