/    Sign up×
Community /Pin to ProfileBookmark

Using a Print Button

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?

to post a comment
HTML

4 Comments(s)

Copy linkTweet thisAlerts:
@DoLordBoyMar 15.2003 — <script language="Javascript1.2">

var message = "Print This Page";

function printpage() {

window.print();


}

document.write("<center><form><input type=button "

+"value=""+message+"" onClick="printpage()"></form>
Copy linkTweet thisAlerts:
@AdamGundryMar 15.2003 — Why not just this?

<input type="button" value="Print This Page" onclick="window.print()">

Adam
Copy linkTweet thisAlerts:
@DoLordBoyMar 15.2003 — good point.

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
Copy linkTweet thisAlerts:
@wsmithauthorMar 15.2003 — [i]Originally posted by AdamGundry [/i]

[B]Why not just this?



<input type="button" value="Print This Page" onclick="window.print()">



Adam [/B]
[/QUOTE]





Thanks Adam, I'll give it a try!
×

Success!

Help @wsmith spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.27,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...