Click to See Complete Forum and Search --> : Print Text within Textarea ONLY


Code One
03-02-2003, 06:53 PM
Again with a lame question . . . I want to print the text within a textarea instead of the entire page, is this possible? And if so what would the code look like . . .? Anyone, any help.

Stefan
03-03-2003, 05:55 AM
I would use CSS and for media="print" I would make everything except the textarea display:none or visibility:hidden

Code One
03-03-2003, 09:16 PM
Originally posted by Stefan
I would use CSS and for media="print" I would make everything except the textarea display:none or visibility:hidden

Hey Stefan,
Im not to up on the CSS coding could you please set me up a simple example on how to structure the code? I can take it from there and incorporate it. If you could that would be great!
Thanks bud.
Code One

Stefan
03-04-2003, 04:12 AM
<head>
<link href="main.css" rel="stylesheet" type="text/css" title="Default" media="screen">
<link href="print.css" rel="stylesheet" type="text/css" title="Default" media="print">
</head>
<body>
<div>
<p>blabla</p>
<teaxtarea></teaxtarea>
<p>blabla</p>
</div>


print.css could look eg like

div * {display:none;}
div textarea {display:block;}

Code One
03-04-2003, 04:19 AM
heres what I did for future questions on this topic . . .

<body>
<style media="print" type="text/css">
.noprint {display:none;}
</style>
</head>
<body>
<p class="noprint">blah blah blah</p> <--this wont print--|
<p><textarea width=100 height=200></textarea></p> <--this will print--|
</body>

Note*:this will print just the textarea but it will include the box outlining the text within.

------------------------------------------------------------------>
Now for my new question: How do I eliminate that from happening?
Code One

Stefan
03-04-2003, 10:05 AM
answered in this thread
http://forums.webdeveloper.com/showthread.php?s=&threadid=5273