If you are wanting to enable the web user to print the currently displayed page, try something like
<input type="button" onclick="window.print();" />
If you want a custom output, create it in a new page (e.g. using
window.open()
) and then include a window.print() in it.
However, please note that you will only get the print options dialog, not the 'select filename' dialog.
Also, note that the print facility may be disabled by group policy or by user preference; in which case, tell them to use the browser menu options.