468,133 Members | 1,123 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,133 developers. It's quick & easy.

disabling Print option in browser ?

Is it possible to disable the print option under file and also the
ctrl-p option on a specific page?
Dec 5 '07 #1
5 9281
pa*****@excite.com said the following on 12/5/2007 8:59 AM:
Is it possible to disable the print option under file and also the
ctrl-p option on a specific page?
No.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Dec 5 '07 #2
wrote on 05 dec 2007 in comp.lang.javascript:
Is it possible to disable the print option under file and also the
ctrl-p option on a specific page?
<body onbeforeprint="while (true) alert('No printing allowed!')">
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Dec 5 '07 #3
"Evertjan." <ex**************@interxnl.netwrote:
wrote on 05 dec 2007 in comp.lang.javascript:
>Is it possible to disable the print option under file and also the
ctrl-p option on a specific page?

<body onbeforeprint="while (true) alert('No printing allowed!')">

Or if you want something cross browser and not quite so drastic:
<style type="text/css">
@media print {
BODY { display: none !important;}
}
</style>

It is still easily defeatable, but should be effective in persuading users
to go elsewhere.

Dec 5 '07 #4
Or if you want something cross browser and not quite so drastic:
>
<style type="text/css">
@media print {
BODY { display: none !important;}}

</style>

It is still easily defeatable, but should be effective in persuading users
to go elsewhere.
Well it is not that I want users to go elsewhere, just that this page
will have a big report on it and I don't want them to print the who;e
thing, about 50 pages worth. I rather they use the View by date
option I have set up and only print the date(s) that they want.

But I did try this:
<style type="text/css">
@media print {
BODY { display: none !important;}}
</style>
And it had no effect. I was still able to do a file print.
Dec 5 '07 #5
On Dec 5, 11:22 am, paul...@excite.com wrote:
Or if you want something cross browser and not quite so drastic:
<style type="text/css">
@media print {
BODY { display: none !important;}}
</style>
It is still easily defeatable, but should be effective in persuading users
to go elsewhere.

Well it is not that I want users to go elsewhere, just that this page
will have a big report on it and I don't want them to print the who;e
thing, about 50 pages worth. I rather they use the View by date
option I have set up and only print the date(s) that they want.
Why would you care what your users print? It's their paper.
>
But I did try this:
<style type="text/css">
@media print {
BODY { display: none !important;}}
</style>
And it had no effect. I was still able to do a file print.
You will find that it does have an effect if you click the print
button on the dialog (i.e. it will print a blank page.)
Dec 5 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by John | last post: by
reply views Thread by Trythat | last post: by
1 post views Thread by kumar | last post: by
1 post views Thread by Avradita | last post: by
1 post views Thread by Albin | last post: by
3 posts views Thread by =?Utf-8?B?QnJ5YW4=?= | last post: by
27 posts views Thread by didacticone | last post: by
1 post views Thread by gcdp | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.