Anyone give me a hint on this?
I have a form with a "Print" button on the page. When the user clicks this it doesn't actually print but opens a condensed version of the page, passing the field contents with php.
On the new (condensed) page I capture the load of the page in js and when it occurs issue the command print(). This works fine.
But once I've done this (printed) I would like to return to my original form. I've tried
if (print()) history.back()
neither seems to work. As an experiment I put the following code at the bottom of my condensed page that prints...
<INPUT type="button" value="Click here to go back" onClick="history.back()">
Clicking on the resulting button does exactly what I want... clears the form and returns me to my original.
I just don't what to
a) print the form with that button on it
b) require user input after the printing.
So... can anyone point me in a way of making history.back() work outside of an onClick construct?
Thank you very much!
Why are you opening a separate copy of the page for printing instead of using a media="print" stylesheet?
Original form is multi purpose
The reason I'm not using the media print style sheet is because the original form is multi-purpose.
When the user needs to print it we only want bits and pieces of the original, not all of it. The second form/page does that reformatting for me.