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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

printing textarea boxes

Status
Not open for further replies.

SKTodd

Programmer
Mar 11, 2002
33
US
I am setting up an HTML form with several TEXTAREA boxes of 75 columns by 3 rows. The users will enter any anount of comments in the boxes and then print the form to allow for manual signatures. When printed, ALL of the data entered in the TEXTAREA fields must print, not just the 3 rows showing on the screen. How do I get the printed version to include the entire TEXTAREA?
 
Well here is one way using email.

<html><head><title>Comments</title></head>
<body bgcolor=&quot;yellow&quot;><b>TO:
XYZ@home.com
&nbsp;&nbsp;&nbsp;&nbsp;SUBJECT:Comments</b>
<form method=&quot;POST&quot;
action=&quot;mailto:XYZ@home.com?subject=Comments
&quot;enctype=&quot;text/plain&quot; target=_blank>
<textarea name=&quot;Data&quot; rows=&quot;3&quot; cols=&quot;75&quot;>
</textarea><br><br><b>
<input type=&quot;submit&quot; value=&quot;Submit&quot;>
</b></form></body></html>
 
Hi mate,

I am going to suggest something but it might not suit what you are trying to acheive..

Could you not instead of using textareas, use blank tables and that way the user can print the whole form and then fill in the fields by hand?

Just a suggestion..

Hope this helps Wullie

 
Thanks for the help Clive and Wullie. The form will be completed online and then printed for signatures so unfortunately emailing or printing an empty form will not work. Do you know of any other forums where I can post this question?
 
Hi mate,

I had another think about this and came up with a possible solution..

The user fills out the form, submits it but instead of submitting it to a mail program just display it on the screen and on this page have a link to print the document..

This way also allows you to have the form set out the way you want it when printed.

Hope this helps Wullie

 
Ok this may seem like a lot of work but it is the only way i know of getting the desired result. Using dhtml you can read the values from the textarea and write them dynamically to divs on the page. These divs do not need to be visible on screen just positioned over the textboxes and with the css property for visibility set top hidden. Ok now you create a print stylesheet which sets the visibility of textareas to hidden and div to visible. instead you could chaneg the display property instead from none to block and vice versa.

If your not sure how to create a print stylesheet all you need is to place a media attribute in the opening style tag or link to the stylesheet. set htis to print for your print stylesheet and screen for the other like this

<style type=&quot;text/css&quot; media=&quot;print&quot;>

if you play around with the styles between the two media you will probably be able to achieve the desired look in printout. you can even have an entirely different layout for the two.

one restrication is print stylesheets are supported only in ie5+ and ns6 so you wont be able to use this for version 4 browsers. about time they all upgraded IMO anyway

P-)

...


hope this helps

rob
 
Hi again mate,

I have come up with a form that will take the data entered in the textareas and pass it on to a basic script that shows the full text entered..

You will need to customise it to fit into your site.

Check it out and tell me if this will do..


Hope this helps Wullie

 
Rob: I'd like to try your solution. I am somewhat of a newbie. How do I write a textarea to a Div?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top