Page 1 of 1

How to take printout by button of php webpage

Posted: Mon Nov 22, 2010 11:48 pm
by ankit.pandeyc012
[text]Hi friends..............
I have a page in which all details of user displays. I want that when user click on button"Print ICard" then ICard is printed and this printed Icard have size of what I desire instead of full page and I also need "Thank You" message on print out which is not displayed in web page....
I don't have much knowledge of css and php. So, please give the full code of it.............
Plzzzzzzzzz help............
Anyone????????????
thanks in advance...................... [/text]

Re: How to take printout by button of php webpage

Posted: Mon Feb 07, 2011 8:54 am
by bestwebdesigner
Hi,
You can use this java script coding for taking print out.

Code: Select all

function winPrint(){
document.getElementById("pButton").style.display = "none";
window.print();
}
...
<button id="pButton" onclick="winPrint()" />
...