#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    27
    Rep Power
    0

    Exclamation PHP Echo - Print Button


    hi

    I have the following which brings up the print window for my page, however, I would only like to print the "echo" form data which is being displayed and not the entire page.

    any suggestions would be greatly appreciated :-)

    Thank you

    Code:
    <script>
    function printpage()
    {
    window.print();
    }
    </script>
    Code:
    <input type="button" value="Print this page" onclick="printpage()" />
  2. #2
  3. A Not To Shabby Code Smurf
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Aug 2008
    Posts
    1,188
    Rep Power
    184
    Really, a JavaScript solution is not needed for this; I mean you could do it, that way..., but I wouldn't. All you really need to do is set-up your CSS (and... your CSS Media attribute to "print"); so that only your form data will display (in a specific html element) and not the rest of your page.

IMN logo majestic logo threadwatch logo seochat tools logo