Click to See Complete Forum and Search --> : I need help with a Print/ Then close script, Please!


D.S.R.Clark
11-08-2003, 11:44 AM
I got this fro the Javascript site. It worked ok on my computer, but does not work on the web. My original goal was to be able to "click" a button and print a hidden page; an order form. But I was told that that could not be done. This was suggested. And it worked ok on my computer, but not the web. Any thoughts????
I had it open to a small box in the corner ( non-obtrusive) then it should close upon clompletion of the print.

Thank you in advance!

David Clark





<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<link rel="File-List" href="GOF_files/filelist.xml">

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function printPage() {
if (window.print) {
agree = confirm('Elizabeth Stewart Clark & Company Order-by-mail. \n\n "Click" OK to print now.');
if (agree) window.print();
}
}
// End -->
</script>



<BODY OnLoad="printPage(),setTimeout(window.close, 500)" bgcolor="#FFFFFF">




</body>

</html>

zachzach
11-10-2003, 02:25 PM
you have to do:

setTimeout('window.close', 500)

you forgot the " ' "-'s

D.S.R.Clark
11-10-2003, 02:45 PM
Thank you for spotting that mistake. But it did not improve the issue.

Is there a way to onprint.close ? instead of setTimeout? Because the page should load into the printer RAM upon clicking the button???

Thank you david