...

View Full Version : How to create a Print Button that prints a certain selection of the page



Legit_Pig
01-12-2010, 07:55 PM
The title says it all but to clarify:

Software: Adobe Dreamweaver CS4
Skills: Not much

I'm working on a .php page that has a form that was converted from Word to HTML. I wanted to add a "Print this page" button to the bottom of the document for easy printability. I want the Print Button to ONLY print the document, not the heading or footer.

Here's what I only want to print when the button is pressed



<center>
<img src="images/black_xxxxxxx.gif" width="73" height="74" alt="xxxxxxx" />
</center>
<p align="center"><font size="4"><strong>DISPUTE RESOLUTION SERVICES</strong></font></p>
<p align="center"><font size="3">MEDIATOR RESPONSIBILITIES</font></p>
<p align="center">Please read the following responsibilities and fill out the information at the bottom of the form.</p>
<ul>
<li>Attend the First Timer's 2-Day Mediation Training. You must be present for the full duration of training.</li>
</ul>
<ul>
<li>You must be willing to mediate <strong>at least one </strong>case each semester (fall, spring, and summer).</li>
</ul>
<ul>
<li> <em>*While we have no way of predicting how much demand there will be for
mediating disputes, we need to know that you are willing to invest this
minimal amount of time and commitment.</em> </li>
</ul>
<ul>
<li>You must attend <strong>at least one</strong> Refresher or Brown Bag ongoing training session each semester (fall, spring, and summer).</li>
</ul>
<p>___<strong>YES</strong>, I am eager to be a part of xxx's Mediation Team and am willing to accept the <br>
responsibilities outlined.</p>
<p>___<strong>NO, </strong>I am not interested in becoming involved at this time.</p>
<p>Signature_______________________________________________ Date: ___________</p>
<p>Print Name_____________________________________________</p>
<p>Email__________________________________________________</p>
<p align="center">Thank you for your interest!</p>
<p align="center">If you have any questions, please feel free to contact us at (xxx) xxx-xxxx or email us at <a href="mailto:xxxxxxxx@xxxx.xxx.xxx">xxxxxxxx@xxxx.xxx.xxx</a></p>
<h3>&nbsp;</h3>

brightyoursite
01-13-2010, 05:28 AM
<style media=print>

.Noprint{display:none;}

.PageNext{page-break-after: always;}

</style>


<input class="Noprint" type="button" onclick="window.print()" value="print" /></div>


use css to hidden the cotent u didnt what to print like print button

brightyour site:http://www.brightyoursite.com

bazz
01-13-2010, 05:43 AM
better to create a stylesheet for print purposes and to make all the parts you don't want printed, set them to display:none.



<link rel='stylesheet' href='whatever' media='print' />


inside the file the sections not for printing would be like



#name_of_element_with_an_id {
display:none;
}


You might want to validate your code too - validator.w3.org :hint:

hth

bazz



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum