Jump to content

Print Area Button


yandoo

Recommended Posts

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  :)

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.