473,378 Members | 1,426 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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 9549
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
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. ...
4
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...
1
by: John | last post by:
Hi How can I disable or hide a menu item via vba? Thanks Regards
0
by: Trythat | last post by:
How can I disable the 'information dialog' that pops up before the print preview form shows itself?
0
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...
1
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 ...
1
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...
1
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...
3
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.