Solved

Only show field on print

Posted on 2000-05-16
3
155 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

707 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

16 Experts available now in Live!

Get 1:1 Help Now