0

I want to detect if the user click the print or cancel button in the printing options in the browser for certain pages (e.g. File -> Print Preview, Print). I like to display a message (separate message if the user click cancel or print).

Here's my code:

function printCheckout() {
    (function() {
        if(print){
              ///if print button click
        } else {
              ///cancel button click
          }

    }());

    window.print();
}
Amirhossein Mehrvarzi
  • 18,024
  • 7
  • 45
  • 70
zook
  • 17
  • 4

1 Answers1

0

You need to implement your own print wizard by popup on print event. You can't define javascript events on browser wizards! They can't be run in such case.

Amirhossein Mehrvarzi
  • 18,024
  • 7
  • 45
  • 70