Forums

Print form does not work in several browsers

NickOg 17 Feb, 2017
Hi
I have used Bob's jQuery form print routine. I have simplified the code for my purpose and have attached a copy. I have commented out the window and document close options so that I can see the output.

My problem is that, while the print routine works fine on some web browsers (Internet Explorer, Firefox & Firefox Developer) (see attached) it will not for other browsers (Edge, Chrome or Opera). In the case of Edge, Chrome or Opera in some cases nothing is displayed. In others - Chrome for example blank pages are displayed. See attached

The form is accessible here

I am quite stuck. Any help???


Regards

Nick
NickOg 17 Feb, 2017
Update: There could be some oddities there. Seems OK on Edge but suddenly two copies printed and format gone awry> 🙄
GreyHead 17 Feb, 2017
Hi Nick,

In Chrome the form loads into the Print Window correctly but the Print Command then shows empty pages. if you cancel the print then you can see the form and ctrl+p will print it correctly, I wonder if this is a timing problem of some kind? If you delay the print half a second does that make any difference?

Bob
NickOg 17 Feb, 2017
Thanks Bob - there is a thought worth a try. Will give it a whirl.
Nick
NickOg 17 Feb, 2017
Hmmm! The right track I think. But probably the wrong jQuery code.
If I make the print line read
    printWin.delay(500).print();

then the window does display but it never then comes out and executes the print.

Is that the correct way to add the delay? I tried adding it as just

    printWin.delay(500);

ahead of the print but no better.

Nick
NickOg 28 Feb, 2017
Morning

I have been struggling with Bob's print routine - it works fine apart from the Chrome/Opera problems mentioned. But getting the correct css into place for each form has been a struggle.

This solved my problem.
http://www.codexworld.com/print-specific-area-of-web-page-using-jquery/
It requires no specific references to my CSS - must pick it up from the page - and works fine with Chrome.

Worth a look.

Regards

Nick
mduda 04 Feb, 2018
Anyone have a solve to this? The print button used to work, but no longer appears, and throws the following on the page...
GreyHead 06 Feb, 2018
Hi mduda,
That is just about impossible to read - it looks like a listing of some of the JavaScript on the page.
Bob
This topic is locked and no more replies can be posted.