Solved

Only show field on print

Posted on 2000-05-16
3
157 Views
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??
0
Comment
Question by:ColumA
3 Comments
 
LVL 1

Accepted Solution

by:
ManoloMA earned 50 total points
ID: 2813709
Try with:

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


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

0
 
LVL 22

Expert Comment

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

Expert Comment

by:nettrom
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>');
}
</script>

And stuff that in the HEAD element.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
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 …
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

813 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now