[Javascript] Printing forms

Allard Schripsema allard-schripsema at procergs.rs.gov.br
Tue Oct 5 15:48:36 CDT 2004


Peter,
Thanks, Great tip, Tested it , works great.
Simple and very efficient, the way i like it.

Allard


  -----Original Message-----
  From: javascript-bounces at LaTech.edu
[mailto:javascript-bounces at LaTech.edu]On Behalf Of Peter Brunone
  Sent: Tuesday, October 05, 2004 5:28 PM
  To: javascript at LaTech.edu
  Subject: re: [Javascript] Printing forms


  Hi Allard,

     You can temporarily expand/restore the textarea and input type="text"
by using the style.overflow property, e.g.

  document.getElementById("myTextArea").style.overflowY = "visible";
  document.getElementById("myTextInput").style.overflowX = "visible";

  will show all content in the textarea, and

  document.getElementById("myTextArea").style.overflowY = "scroll";
  document.getElementById("myTextInput").style.overflowX = "hidden";

  will put it back the way it was.

     This should be fairly easy to roll out across a lot of forms, assuming
you have a central include script (or broad, sweeping search/replace
capabilities a la HomeSite).  You could encapsulate this in a function that
steps through the form and gets all elements of type "textarea", or
something clever like that...

  Cheers,

  Peter Brunone
  ______________
  EasyListBox.com


  From: "Allard Schripsema" allard-schripsema at procergs.rs.gov.br

  Hi All,

  I have a question for you all,(couldn?t find an answer on the internet)
  related to printing forms (in IE):
  How do you avoid the problem of not printing the complete content of a
  form-element?

  Example: A form with a textarea with 4 lines, but the content has 8 lines
  (and a scrollbar), or a textinput with size < maxlength etc....

  Printing those will give you only the visible part, not the complete
  content.

  What i?m looking for is a (more or less) generic function/idea/solution

  One option i can see is temporary changing sizes, rows and columns ect,
  Another is getting th e innerHTML of the body and removing all unnecessary
  code before printing... (What is important at the moment is the content,
not
  the layout)

  It should be a generic solution, because it must work on more than 1000
  forms... (WBIS)

  Anybody has already tackled this problem?
  Ideas?

  Thanks,
  Allard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20041005/61d013e0/attachment.htm>


More information about the Javascript mailing list