Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Oct 2009
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to create a Print Button that prints a certain selection of the page

    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

    Code:
    <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>
    Last edited by Legit_Pig; 01-12-2010 at 08:20 PM.

  • #2
    New Coder
    Join Date
    Jan 2010
    Posts
    35
    Thanks
    0
    Thanked 1 Time in 1 Post
    Code:
    <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

  • #3
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    better to create a stylesheet for print purposes and to make all the parts you don't want printed, set them to display:none.

    Code:
    <link rel='stylesheet' href='whatever' media='print' />
    inside the file the sections not for printing would be like

    Code:
    #name_of_element_with_an_id {
    display:none;
    }
    You might want to validate your code too - validator.w3.org :hint:

    hth

    bazz
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •