Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

@media print

Status
Not open for further replies.

TheConeHead

Programmer
Aug 14, 2002
2,106
US
This might sound crazy, but is it possible, through css, to have a textfield on a page, when printed out, just show the value and not the textbox, or the selected value of a dropdown and not the dropdown?

make sense?

[conehead]
 
of course. just create a separate style definition for each.

for input boxes, this is easier (usually) - just set the border to 0, then style all other things (colors, fonts, text-align) appropriately.

select boxes may be a bit more tricky. you can style the arrow and whatnot to be transparent, but i'm not sure this is kosher in all browsers. what you might consider is creating a text input that is normally hidden, have it update with the value of the select box whenever the select box changes, and only display this text box when you're printing (and hide the select).

get me?



*cLFlaVA
----------------------------
[tt]"quote goes here"[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
I gotcha, but here's the thing - I don't want the space of the textboxes either... So say I have a value of "Hi" in a textbox with a size of 150 - I want that size to go away too...

make sense?

[conehead]
 
Yes, like cLFlaVA says -just make the separate stylesheet for printing w/o any with set to your textbox... It should work then?
 
nah, that doesn't work. nor does setting width to auto, or display to inline.

conehead,

i'm not sure there's a way (without the javascript method). perhaps another person has a better idea for you.

sorry.



*cLFlaVA
----------------------------
[tt]"quote goes here"[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
I have accomplished that via [tt]width: 0; overflow: visible;[/tt] I think, but it only worked in IE. But maybe if you try playing around some more...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top