fmwebschool.com
Top Experts [learn more]Top 4-10
webko

9743 K
bandmandq

2458 K
Genx

1525 K
4. tcmeyers
5. kbata
6. Martie
7. Hammerton
8. rrenfrow
9. bneeman
10. plegler
Welcome, Guest. Please login or register.
June 19, 2013, 01:23:34 PM

Login with username, password and session length
Search:     Advanced search
Welcome to the FileMaker Web Masters Exchange.  If you have any questions about how to use this forum, please watch the getting started movie at:
http://www.fmwebschool.com/movies/forum1/forum1.html
27508 Posts in 6074 Topics by 1524 Members
Latest Member: fmwebster
* Home Help Search Calendar Login Register
+  fmwebschool.com
|-+  Other Resources
| |-+  Free JavaScript Code Snips
| | |-+  Print out the current page
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: Print out the current page  (Read 17995 times)
FMWebschool
FMWebschool Team
Administrator
Hero Member
*****
Offline Offline

Posts: 1026
Kudos: 1383


Allyson Olm, Chief Developer


WWW
Applications:
« on: February 01, 2006, 08:04:05 AM »

By adding this code to your Web site, users can print out the current page by simply clicking a button.

<!-- TWO STEPS TO INSTALL PAGE PRINTER:

  1.  Copy the coding into the HEAD of your HTML document
  2.  Add the last code into the BODY of your HTML document  -->

<!-- STEP ONE: Paste this code into the HEAD of your HTML document  -->

<HEAD>

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
function varitext(text){
text=document
print(text)
}
//  End -->
</script>

</HEAD>

<!-- STEP TWO: Copy this code into the BODY of your HTML document  -->

<BODY>

<DIV ALIGN="CENTER">
<FORM>
<INPUT NAME="print" TYPE="button" VALUE="Print this Document!"
ONCLICK="varitext()">
</FORM>
</DIV>
Logged

In Kindness
FMWebschool Team
http://www.fmwebschool.com
http://www.fxforge.net
800.353.7950
rwalsh
Jr. Member
**
Offline Offline

Posts: 54



Applications:
« Reply #1 on: March 18, 2008, 09:16:16 AM »

Just curious, as this is  nice to have feature, is there a way to supress the buttom from printing out?
Logged
webko
Global Moderator
Hero Member
*****
Offline Offline

Posts: 2060
Kudos: 9743



WWW
Applications:
« Reply #2 on: March 19, 2008, 04:43:54 PM »

Sure... you need a style that indicates that bit is not to be printed...

Put something like this in the head section:

Code:
<style type="text/css">
<!--
@media print {
  .DONTPrint{ display:none }
}
-->
</style>

Then put a span using that style around the button:

Code:
<span class="DONTPrint">
<INPUT NAME="print" TYPE="button" VALUE="Print this Document!"
ONCLICK="varitext()">
</span>
« Last Edit: February 11, 2009, 05:36:44 PM by webko » Logged

tim.webko_at_gmail.com
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!