Solved

How to add a print button on a web page

Posted on 2006-07-17
7
1,731 Views
Last Modified: 2013-12-24
How do  I add a print button on a web page in Front Page so that my viewers can print the page without using their browser's print function?
0
Comment
Question by:Sewingirl2000
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 20

Expert Comment

by:dopyiii
ID: 17130539
Here's what you need:

<html>
<head>
<script type="text/javascript">
function printpage()
{
window.print()
}
</script>
</head>

<body>
<form>
<input type="button" value="Print this page"
onclick="printpage()">
</form>
</body>

</html>
0
 

Author Comment

by:Sewingirl2000
ID: 17131693
Can you please tell me how to insert this into the html page in front page on the page that I want to display the button.
THanks
0
 
LVL 20

Accepted Solution

by:
dopyiii earned 250 total points
ID: 17132045
Well, you actually have a couple of ways.  In FrontPage, you can insert a form and then a button, but I find it just as easy to add the code manually because you'd have to add the script stuff by hand anyway.

Just put your cursor where you'd like the button to be and then click the HTML tab on the bottom of the viewer to switch to the HTML code.  The cursor should be in the code where it was on the page (if not, try selecting something right next to where you want the button - this will just help to get you oriented).

Once you're there, paste the <form>...</form> tags (and what's in between).  This will put the button on the form.  As you can see, the <script.... /script> stuff goes in the <head></head> tags in top of the document.

You might have to play with it a bit.  If you know how to insert a form using FrontPage, you might try inserting a form with the button using the GUI, then going into the code and changing the onclick attribute for the button's input tag.

Does that help?
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 

Author Comment

by:Sewingirl2000
ID: 17165356
Thanks, I will give it a try. I have been away from the computer for a few days. Tonight, I will try this solution for the print function and let you know how it works. I appreciate the help. I'll give it a try right now.
0
 

Author Comment

by:Sewingirl2000
ID: 17165396
Ok I am sorry, but I don't get it.  Can you try explaining one more time.  Thanks a million.
0
 

Author Comment

by:Sewingirl2000
ID: 17165429
YES!   IT worked!  THANKS!  This is so wonderful.  Is there a way to print the form without printing the shared borders on the webpage?  THANKS!
0
 
LVL 20

Expert Comment

by:dopyiii
ID: 17167191
You're welcome!  Seems like once you do this sort of thing once or twice it seems so simple :)

I'm not sure about the shared border thing, though.  I believe that's a browser feature and I'm not sure you can turn that off even with scripting.  But, it should only be a Firefox thing - I don't see the border in IE if that helps at all.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Turn A Profile Picture Into A Cartoon Using Photoshop And Illustrator This tutorial will teach you how to make a cartoon style image out of a regular picture. I have tried to keep the tutorial as simple as possible. I used Adobe CS4 for this tuto…
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
The purpose of this video is to demonstrate how to integrate Mailchimp with Facebook. This will be demonstrated using a Windows 8 PC. Mailchimp and Facebook will be used. Log into your Mailchimp account. : Click on your name. Go to Account Setti…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question