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 2 of 2
  1. #1
    New Coder
    Join Date
    Sep 2011
    Posts
    20
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Disable ability to print a web page?

    Hello all,

    We have a job management system which contains a form where our employees input job information. When the form is submitted it brings you to a page that looks almost identical to it. On this page, the input fields have been changes to the user's submitted text. When this page loads, so does the print dialog so the user can print it instantly.

    The problem is that since the form and the print page look the same, some of our employees (out of habit from our old system) hit ctrl+p and print the form before submitting it.

    Since there is a way to automatically bring up the print dialog, I was wondering if there is a way to disable it all together.

    This system is used only by our employees who all use the latest version of Firefox. The solution only needs to work for this browser.

    Any help is greatly appreciated. Thank you!

  • #2
    Senior Coder Rowsdower!'s Avatar
    Join Date
    Oct 2008
    Location
    Some say it's everything.
    Posts
    2,027
    Thanks
    5
    Thanked 397 Times in 390 Posts
    You could put an "onkeydown" event listener on the page and watch for the ctrl button to be pressed and create an annoying javascript alert calling them obscene names (or maybe just reminding them not to print yet).

    Unless there is anything else in the page that *would* require use of the ctrl button you could get away with the least effort by doing something like that.

    Alternatively, you could go with something like this, which is more targeted (and since someone else wrote it, it's still easy):

    http://www.arraystudio.com/as-worksh...avascript.html
    The object of opening the mind, as of opening the mouth, is to shut it again on something solid. G.K. Chesterton
    See Mediocrity in its Infancy
    It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
    Seek and you shall find... basically:
    validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting


  •  

    Posting Permissions

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