Using a Print Button

liunx

Guest
I am working on a site that I need to make a calander of upcoming events and I would like to use a Print button, so viewers could print out the info. How do I make this work?<!--content--><script language="Javascript1.2"><br />
var message = "Print This Page";<br />
<br />
function printpage() {<br />
window.print(); <br />
}<br />
<br />
document.write("<center><form><input type=button "<br />
+"value=\""+message+"\" onClick=\"printpage()\"></form><!--content-->Why not just this?<br />
<br />
<input type="button" value="Print This Page" onclick="window.print()"><br />
<br />
Adam<!--content-->good point.<br />
<br />
I just cut and pasted my code from a page on my site that I got from a javascript tutorial. Not sure why it wasted all that time, but I can't say I know much about programming aside from how to press Ctrl C and Ctrl V<!--content-->Originally posted by AdamGundry <br />
Why not just this?<br />
<br />
<input type="button" value="Print This Page" onclick="window.print()"><br />
<br />
Adam <br />
<br />
<br />
<br />
<br />
Thanks Adam, I'll give it a try!<!--content-->
 
Back
Top