yandoo Posted April 14, 2008 Share Posted April 14, 2008 Hi there, I was hoping for some help with my php project please... I need to create a button that will print an area of my web page (middle of page showing records). I this possible??? I so how please??? Could somebody point me indirect of script or tutorial please?? Kind Regards Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted April 14, 2008 Share Posted April 14, 2008 Printing a page is a job for javascript. Weather or not you can have javascript print a portion of the page i'm not sure. Im not aware of a way, but then im no expert. Perhaps you will need to have the button launch a page containing the information you want printed and print from there. Quote Link to comment Share on other sites More sharing options...
poleposters Posted April 14, 2008 Share Posted April 14, 2008 As far as I know you'll need to create a link or button that says print.This will open up a seperate window which only displays the information you want printed. In a print friendly format ie paper size. To create this page all you need to do is reuse the part of the script that displays only the information you want to print. Then its simply a matter of displaying a print submit button using javascript use this code echo '<a href="javascript:window.print()">print</a>'; There might be a more elegant way to do this without opening a second browser window. But i'm unaware of this. Check out a javascript forum for more info. Although the above is the simplest way it is usually done. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.