473,804 Members | 3,380 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 9572
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.javas cript 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.javas cript:
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.net wrote:
wrote on 05 dec 2007 in comp.lang.javas cript:
>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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
5470
by: Dave Smithz | last post by:
Hi There, I have a PHP script that sends an email with attachment and works great when provided the path to the file to send. However this file needs to be on the same server as the script. I want to develop a webpage where people can send attachments that are stored on their local PC.
4
2418
by: k | last post by:
A programming the internet class has been asked if it is possible to 'grey out' the View Source option in a browser menu. Multiple respondents think it is possible but not sure how to do it. I have seen the 'Print' option greyed out at some sites... Can you provide or recommend a specific way of achieving this?
1
1450
by: John | last post by:
Hi How can I disable or hide a menu item via vba? Thanks Regards
0
357
by: Trythat | last post by:
How can I disable the 'information dialog' that pops up before the print preview form shows itself?
0
259
by: Bill Nguyen | last post by:
I have a report that would gray out the print icon when preview (in a .NET VB app). This report uses an SQLserver stored procedure. Other reports using view or tables do not have this problem. I verified the report in Crystal 8.5 design time and found no different settings among those. Any suggestion is greatly appreciated. Bill
1
1199
by: kumar | last post by:
Hello every one, Can any one help me how can i print values of my webpage with just a button in the webpage. From http://www.developmentnow.com/g/8_0_0_0_0_0/dotnet-framework-aspnet.htm Posted via DevelopmentNow.com Groups http://www.developmentnow.com
1
1240
by: Avradita | last post by:
Hello to all, I have a website where I would like to place a print button so that the user from his/her end can take a print out of any particular page. I know that this can be done with the help of javascript , but my question is how will the total page that I am viewing on the screen (i.e. the width of the page) gets accomadated in one A4 size paper. I want the whole site getting squeezed in the A4 size paper and nothing gets cut off from...
1
1371
by: Albin | last post by:
Hi, I have a form in which i have two text boxes one for entering email and the other for verify email (to make sure the user entered the correct email id we are asking to enter the same email id twice),I need to restrict copy feature in both the fields (that is the user should not be able to copy text data from the email and confirm email text boxes) , are there any properties for text box using which i can do this or should i try using java...
3
5286
by: =?Utf-8?B?QnJ5YW4=?= | last post by:
I have an application that hosts a web browser control. I would like to detect when ever the browser tries to print a page and rather than print the document, store the print job off in a database for printing at a later time. There are some other controls in my application that the user could print from, so I can't have this specifically coded to the browser control. It need to intercept any print message generated from my application. ...
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9579
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10319
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10076
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6851
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5520
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4297
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3816
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.