Solved

How to add a print button on a web page

Posted on 2006-07-17
7
1,716 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
  • 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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Renaming file after uploading in Coldfusion 4 248
Facebook custom search 4 183
YouTube Friendly Video Addresses 3 87
Build and evolve an interactive experience 1 96
In this short web based tutorial, I wanted to show users how they can still use the powers of FrontPage in conjunction with Expression Web 3.  Even though Microsoft eliminated the use of Web components, we can still use them with FrontPage and edit …
Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…

776 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