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, t开发者_开发问答here 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?
<button id="printbutton" onclick="window.print();" />
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()" />
精彩评论