Results 1 to 3 of 3
Thread: Using history.back()
Aug 3, 2007, 16:55 #1
- Join Date
- Nov 2005
- 0 Post(s)
- 0 Thread(s)
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!