Want company and other items in a single customer invoice, so trying to make an adjusted copy of our completed company invoice in a new window that does not save to our database. This jscript works fine:
function copy()
{
var text = document.getElementById('copy').innerHTML;
text = text.replace(/readonly/gi, '');
text = text.replace(/hideit/gi, '');
var html = "<html><head><link rel='stylesheet' type='text/css' href='invoice.css'></head><body>" + text + "</body></html>";
var newWindow = window.open("","Test");
newWindow .document.write(html);
}
I would like a bit of jscript in the new window to automatically update totals etc. when items are added but as soon as I put
<script type='text/javascript' src='invoice.js'></script> in the above string it stops working. Is it due to </jscript> in the string?
Any ideas? Ta.
function copy()
{
var text = document.getElementById('copy').innerHTML;
text = text.replace(/readonly/gi, '');
text = text.replace(/hideit/gi, '');
var html = "<html><head><link rel='stylesheet' type='text/css' href='invoice.css'></head><body>" + text + "</body></html>";
var newWindow = window.open("","Test");
newWindow .document.write(html);
}
I would like a bit of jscript in the new window to automatically update totals etc. when items are added but as soon as I put
<script type='text/javascript' src='invoice.js'></script> in the above string it stops working. Is it due to </jscript> in the string?
Any ideas? Ta.
Comment