Only show field on print

Posted on 2000-05-16
Medium Priority
Last Modified: 2010-04-09
I would like to set some textfields on my checkout-page, wich only appear when the customer will print the page and otherwise are hidden. Any idea??
Question by:ColumA

Accepted Solution

ManoloMA earned 150 total points
ID: 2813709
Try with:

<style MEDIA="screen">
      .text   { display:"none"; }

<input type="text" class="text">

LVL 22

Expert Comment

ID: 2814538
that'll only work with IE 5 though....not that I have an option out of the top of my head.

Expert Comment

ID: 2814922
If I remember correctly a Netscape 4.x window is 0x0 pixels when it's printed, so you could do:

<script type="text/javascript">
if(document.layers && window.innerWidth == 0 && window.innerHeight == 0) {
document.write('<style type="text/css">.text { display: none; }</style>');

And stuff that in the HEAD element.

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

607 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