I’m a novice at javascript and was wondering if there is any way to combine the contents of several s into a single textarea in a new window?
I have a document in which the user currently has to copy/paste the contents of different textareas individually. I would like them to have the option of clicking a button to generate this.
I looked through this forum and managed to get close using:
<input type="button" value="combine" onclick="document.getElementById('textarea3').value=document.getElementById('textarea2').value+' '+document.getElementById('textarea3').value" />
However, I’ve only been successful in combining these two textareas to another textarea on the same page. I’m not able to combine this onclick event with a newWindow function to generate a clean page with the intended text.
Thanks!
You have to pass the value of combined textarea to some persistent variable. I will suggest to use localStorage. Here is some example:
First Page
On second page put this script block at the bottom of body