SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Printing selected page?

    Hello.

    I have a frame which hosts a html page which in turn is calling a flash file.

    Now within the HTML document I have added a button onclick window.print()

    what this does for me is one the first page it prints out just teh button and on the second one it actually prints the flash file.

    Is there a way I can stop the first page from printing.

    Any other alternatives.

    the code is as follows..

    <input type=button name="cmdPring" value="Print" onclick=" javascript:window.print()" style="float: right">

    Ive tried window.self ; frame.print.

    everything taht works prints the first page with teh button alone on it.

    thanks all.

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,786
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Use stylesheet commands to determine what part of the page is supposed to print.

    See http://javascript.about.com/library/blprint.htm for more info.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Print button still prints

    Thanks for the information.

    I tried putting a class=print for the frame but it still prints the print report button calling the object on a seperate page.

    thanks.


Bookmarks

Posting Permissions

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