473,427 Members | 1,773 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,427 software developers and data experts.

in print output hide content in <input> but keeps the border

hello.

Is it possible to design CSS in the way that content in <inputare not
visible in print out (a.k.a. value of <inputnot visible) while the
border remain visible?

trial:

input {
border: thin solid black;
visibility: hidden;
}

result:

border also hidden.

trial:

input {
border: thin solid black;
color: white;
}

result:

IE fine. In firefox, the printed color automatically change to black

trial:

input {
border: thin solid black;
color: #eeee;
}

result
same as above.

trial:

@media print {
input {
border: thin solid black;
color: #eeee;
}
}

result
same as above.

Note that adding a container around <inputwould solve the problem by
defining border for the container and set <inputhidden. However this
is a last resort because in the web application I am working on, <input>
is generated by a widget library that refer to this element in 100
different places by javascript, adding a container around <inputwould
mean I have to work on a dozen javascripts that assumed <inputdoesn't
have a container.

Any suggestion?
Aug 19 '08 #1
8 3598
On Tue, 19 Aug 2008 10:52:01 +0800
Zhang Weiwu <zh********@realss.comwrote in:
<6g************@mid.individual.net>
hello.

Is it possible to design CSS in the way that content in <inputare
not visible in print out (a.k.a. value of <inputnot visible) while
the border remain visible?
[snip]
Any suggestion?
Have you tried color:transparent;
--

BootNic Tue Aug 19, 2008 01:06 am
A person without a sense of humor is like a wagon without springs,
jolted by every pebble in the road.
*Henry Ward Beecher*

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)

iEYEARECAAYFAkiqVPwACgkQylMUzZO6jeIotQCgneqPeT9BbO r8T4W8lkl5L5wY
YKAAnjVuzEn5wQjSevHNsTF33qs5R3ZY
=u1is
-----END PGP SIGNATURE-----

Aug 19 '08 #2
BootNic wrote:
On Tue, 19 Aug 2008 10:52:01 +0800
Zhang Weiwu <zh********@realss.comwrote in:
<6g************@mid.individual.net>
>hello.

Is it possible to design CSS in the way that content in <inputare
not visible in print out (a.k.a. value of <inputnot visible) while
the border remain visible?
[snip]
>Any suggestion?

Have you tried color:transparent;
The value "transparent" is valid only for background-color, not for color.
Aug 19 '08 #3
On Tue, 19 Aug 2008 11:02:25 -0400
Harlan Messinger <hm*******************@comcast.netwrote in:
<6h************@mid.individual.net>
BootNic wrote:
>On Tue, 19 Aug 2008 10:52:01 +0800
Zhang Weiwu <zh********@realss.comwrote in:
<6g************@mid.individual.net>
>>hello.

Is it possible to design CSS in the way that content in <inputare
not visible in print out (a.k.a. value of <inputnot visible) while
the border remain visible?
[snip]
>>Any suggestion?

Have you tried color:transparent;
The value "transparent" is valid only for background-color, not for color.

True it is. Did ya give it a go in FireFox?

<style type="text/css" media="print">
input, x:-moz-any-link {
color:transparent;
}
</style>

--

BootNic Tue Aug 19, 2008 12:08 pm
Nothing is stronger than habit.
*Ovid*

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)

iEYEARECAAYFAkiq8CQACgkQylMUzZO6jeIO3ACcDApfpTrSaA xXWfHdUVmeaRtA
ngcAoM7cmidgXT64eeytnlEOdGFr3ixE
=M6Pg
-----END PGP SIGNATURE-----

Aug 19 '08 #4
BootNic wrote:
On Tue, 19 Aug 2008 11:02:25 -0400
Harlan Messinger <hm*******************@comcast.netwrote in:
<6h************@mid.individual.net>
>BootNic wrote:
>>On Tue, 19 Aug 2008 10:52:01 +0800
Zhang Weiwu <zh********@realss.comwrote in:
<6g************@mid.individual.net>

hello.

Is it possible to design CSS in the way that content in <inputare
not visible in print out (a.k.a. value of <inputnot visible) while
the border remain visible?

[snip]
Any suggestion?
Have you tried color:transparent;
The value "transparent" is valid only for background-color, not for color.


True it is. Did ya give it a go in FireFox?

<style type="text/css" media="print">
input, x:-moz-any-link {
color:transparent;
}
</style>
Does it work? Does it depend on whether you're using a doctype that puts
Firefox into standards mode?
Aug 19 '08 #5
On Aug 18, 10:52*pm, Zhang Weiwu <zhangwe...@realss.comwrote:
hello.

Is it possible to design CSS in the way that content in <inputare not
visible in print out (a.k.a. value of <inputnot visible) while the
border remain visible?

trial:

* input {
* *border: thin solid black;
* *visibility: hidden;
* }

result:

* border also hidden.

trial:

* input {
* *border: thin solid black;
* *color: white;
* }

result:

* IE fine. In firefox, the printed color automatically change to black

trial:

* input {
* *border: thin solid black;
* *color: #eeee;
* }

result
* same as above.

trial:

* @media print {
* *input {
* * *border: thin solid black;
* * *color: #eeee;
* *}
* }

result
* same as above.

Note that adding a container around <inputwould solve the problem by
defining border for the container and set <inputhidden. However this
is a last resort because in the web application I am working on, <input>
is generated by a widget library that refer to this element in 100
different places by javascript, adding a container around <inputwould
mean I have to work on a dozen javascripts that assumed <inputdoesn't
have a container.

Any suggestion?
Have you considered

display: none

This may do what you want.
Aug 20 '08 #6
Helpful person wrote:
On Aug 18, 10:52 pm, Zhang Weiwu <zhangwe...@realss.comwrote:
>hello.

Is it possible to design CSS in the way that content in <inputare not
visible in print out (a.k.a. value of <inputnot visible) while the
border remain visible?

trial:

input {
border: thin solid black;
visibility: hidden;
}

result:

border also hidden.

trial:

input {
border: thin solid black;
color: white;
}

result:

IE fine. In firefox, the printed color automatically change to black

trial:

input {
border: thin solid black;
color: #eeee;
}

result
same as above.

trial:

@media print {
input {
border: thin solid black;
color: #eeee;
}
}

result
same as above.

Note that adding a container around <inputwould solve the problem by
defining border for the container and set <inputhidden. However this
is a last resort because in the web application I am working on, <input>
is generated by a widget library that refer to this element in 100
different places by javascript, adding a container around <inputwould
mean I have to work on a dozen javascripts that assumed <inputdoesn't
have a container.

Any suggestion?

Have you considered

display: none

This may do what you want.
That will hide the input field. The OP said he only wants to hide the
text *in* the field.
Aug 20 '08 #7

Jonathan N. Little wrote:
@media print {
form span input { visibility: hidden; }
form span { border: 1px solid black; }
}

<span><input type="text" value="Not printable"></span>
Or simpler, maybe:
@media print {
input[type="text"] {background:#fff; color:#fff}
}

--
Berg
Aug 20 '08 #8
Bergamot wrote:
Jonathan N. Little wrote:
> @media print {
form span input { visibility: hidden; }
form span { border: 1px solid black; }
}

<span><input type="text" value="Not printable"></span>

Or simpler, maybe:
@media print {
input[type="text"] {background:#fff; color:#fff}
}
It would be if it would work, unfortunately Gecko at least seems to
override the style internally. If the form field is printable so will
the text!

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Aug 21 '08 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Don | last post by:
Using PHP, I'm creating an <input> tag. How do you delimit the text string for the value parm of an <input> tag, when the string contains the delimit char? Example: <input...value="This text...
2
by: not 2 swift | last post by:
I thought I would update an old page on which I had used a <INPUT TYPE=image ...> with a <BUTTON><IMG SRC=...></BUTTON> The problem is that <BUTTON> always provides a shadow/emboss effect. Can...
3
by: TR | last post by:
Is it possible with CSS to prevent this wrapping alignment with a checkbox with a nested label? This is the label of the checkbox that wraps beneath it I'd prefer it looked like...
3
by: Ben | last post by:
Here's my form: <form name="aForm" method='post'> <input type=file name=file1 onkeypress='KeyPress()'><br> <a id='attachMoreLink' href='javascript:AddFileInput()">Attach More Files </a> <input...
5
by: Bart van Deenen | last post by:
Hi all I have a form with a couple of input fields, embedded within spans. I am using script.aculo.us for dragging and dropping, and want to reorder the input fields that way. The input fields are...
4
by: Steve Swift | last post by:
If it is possible, could someone demonstrate how to make the text entered into an <INPUT TYPE=TEXTfield right-align within the entry field, please? The fields in my form are for numbers, and...
2
by: Richard Maher | last post by:
Hi, I'm trying to use the Visibility Style attribute for a Div to effectively PopUp a lightweight window with some additional context-sensitive information, when a user mouses over a given...
1
by: JPhilS | last post by:
Hi to all Webmaster! I have discover this problem when I inserted the scores of the students i a centain subject. I am making a school project with regards to saving students' record. first, I...
1
by: test9991014 | last post by:
Hi folks, I've got something like this: <table> <tr> <td>1</td> <td align=center> <input type=text> </td>
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.