This topic is locked
[SOLVED]

 Phprunner 8_23092 Print

12/1/2014 3:34:05 PM
PHPRunner General questions
S
safesurf author

I have PHPRunner 8_23092 and would like to have the printer friendly page automatically open the Print Dialog Box. I put the window.print (); in JavaScript OnLoad event of printer friendly page and nothing happens. What is the best way to make this work?

D
DealerModulesDevClub member 12/4/2014



I have PHPRunner 8_23092 and would like to have the printer friendly page automatically open the Print Dialog Box. I put the window.print (); in JavaScript OnLoad event of printer friendly page and nothing happens. What is the best way to make this work?


If I am understanding you correctly, you can try this:
Copy and paste the following code in between the <head> tags of the printer friendly version:
<script language="Javascript1.2">

<!--

function printpage() {

window.print();

}

//-->

</script>
THEN:
Add onload="printpage()" to your <body> tag as shown below:
<body onload="printpage()">

S
safesurf author 12/12/2014

I got the Print Dialog Box to automatically open using the Printer friendly page Before display event.
Printer-friendly page Before display event:

echo "<script>javascript:window.print()</script>";