Posted on 2008-02-02
This is a really easy one, but I'm still having trouble >_>
I have one page which displays a list of invoices. Each invoice has a little "print" button beside it.
So what I wanted to do was open a popup from my list page, which displayed the print page. Then I wanted to call the print page's "startPrint()" function, and finally close the page, all in one action.
I have this so far for my link:
<a onclick="oW = window.open('', 'print', 'scrollbars=no,width=50,height=50'); oW.startPrint(); oW.close()" target="print" href="invoice_print.php?invoiceid=3">Print</a>
And the popup opens, in the right place, with the right page in it. But the startPrint() function can't be found.
Here's how I declared the startPrint() function in the invoice_print.php page:
document.all.print.style.visibility = 'hidden';
setTimeout('document.all.print.style.visibility = \'visible\'', 500);
Can anyone help me make this function call work?