Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

javascript button to print web page 1

Status
Not open for further replies.

jund

Instructor
Feb 13, 2001
11
0
0
US
Does anyone have a javascript program that creates a button (on the page)that allows the user to print the web page the user is visiting? For example, I have a club site that has a membership form on it that the member must print via their printer. But, most of them do not know how to set the printer up correctly... i.e., "shrink to fit" when printing.
 
;) and for older browser or not-compatible ones, you can even try :
<input type=&quot;button&quot; onclick=&quot;if (window.print()) window.print() else alert(\&quot;listen i'm really sorry but it seems you'll have to do it yourself. File -> Print ... \n thank you :)\&quot;)&quot; value=&quot;Print&quot;>

 
maybe make it:

if (window.print)

Otherwise if you leave the ()'s there, it will try to call window.print and receive a return value, and test against that. jared@aauser.com -
 
yes you're right - i'll never ever be as complete and precise as you are >:-( !!!!! (actually i was checking if you didn't fall asleep reading ms docs ;))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top