Hiding fields in the printed HTML page

Posted on 2003-02-19
Medium Priority
Last Modified: 2010-04-07

     I have a page which has Print button.If user clicks print button the page will be printed.I want the page to be printed without print button.

Can any one give idea?

Thanks and Regards,
Abdul Raheem .S
Question by:sar05

Expert Comment

ID: 7986892
Simply remove the button from your page. Let the users print by File/Print, or rigth mouse button.


Expert Comment

ID: 7991708
cvginkel is right. you can removed the button from your page. So that users can print using menu option or right click.


Expert Comment

ID: 7992960
Is this a button made by you?  In that case, use server side code with querystring.

<%If Request.QueryString("print") <> "yes" Then
   <a href="printme.htm?print=yes">Print</a>
<%End If%>

but if it is an internet explorer(or any browser based button for that matter) print button, then you can't.  You can only fire the event.

Good luck.

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.


Expert Comment

ID: 7995639
Put the print button in a layer.  Once they click the button, do a hide on the layer and execute the print function.
LVL 53

Accepted Solution

COBOLdinosaur earned 200 total points
ID: 7995882
Put this in the head:

@media print{ .prtbutton {display:none; } }

Then apply the class to the button:

<input type="button" value="print" class="prtbutton">


Expert Comment

ID: 8059918
COBOLdinosaur has the answer and should get credit!!!  Use CSS with the @media print type...
LVL 53

Expert Comment

ID: 9305689
This question has been classified abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.

Unless it is clear to me that the question has been answered I will recommend delete.  It is possible that a Grade less than A will be given if no expert makes a case for an A grade. It is assumed that any participant not responding to this request is no longer interested in its final disposition.

If the user does not know how to close the question, the options are here:



Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
The purpose of this video is to demonstrate how to create a Printer Friendly PDF on a WordPress Page. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome Screenshot” Google Chrome Extension, and SmallPDF.com Log…
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…
Suggested Courses
Course of the Month9 days, 11 hours left to enroll

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question