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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

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.

WordPress Tutorial 2: Terminology

An important part of learning any new piece of software is understanding the terminology it uses. Thankfully WordPress uses fairly simple names for everything that make it easy to start using the software.


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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Now that Expression Web 4.0 (http://www.microsoft.com/expression/products/Upgrade.aspx) is free if you buy or have the full version of Expression Web 3.0, now is the best time to  migrate from FrontPage to Expression Web (http://www.frontpage-to-exp…
This guide will walk you through the essential considerations and tech stack for building scalable websites. Know how to grow your business the smart way!
The purpose of this video is to demonstrate how to connect a WordPress website to Google Analytics. This will be demonstrated using a Windows 8 PC Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php :…
The purpose of this video is to demonstrate how to make a WordPress Site faster and smaller in size by cleaning up the database. This will be demonstrated using a Windows 8 PC. Plugin WP Optimize will be used. Go to your WordPress login page. T…

762 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