1

Possible Duplicate:
How to print a portion of an HTML page?

I am making a quotation online. I want the user to be able to print it.

I have seen my exact requirement on this webpage. On this web page, there is a print option. When the user clicks on print it will send a print command to the printer if a printer is attached.

Does anyone know how can I do that?

Community
  • 1
  • 1
Haseeb Warraich
  • 141
  • 1
  • 2
  • 12

2 Answers2

14
<button id="printbutton" onclick="window.print();" />
Explosion Pills
  • 188,624
  • 52
  • 326
  • 405
1

I'm quite confused by your question...

To trigger a print programatically with JavaScript (PHP won't help you much), you can call window.print() :

<input type="button" onclick="window.print()" />
Blender
  • 289,723
  • 53
  • 439
  • 496