Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3627524
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T23:53:58+00:00 2026-05-18T23:53:58+00:00

I have a form with some text areas that allow a scroll bar when

  • 0

I have a form with some text areas that allow a scroll bar when the text exceeds the text box. The user would like to be able to print the screen, and this text is not visible. How do I make all of the text visible for just printing? Am I better of making a print to pdf link or something?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T23:53:59+00:00Added an answer on May 18, 2026 at 11:53 pm

    You cannot solve this problem with CSS alone.

    Why Pure-CSS Solutions are Insufficient (with demo)

    Let me convince you the answers involving print stylesheets and overflow: visible are insufficient. Open this page and look at the source. Just what they suggested, right? Now print preview it (in, say, Chrome 13 on OS X, like me). Note that you can only see a line or two of the note when you attempt to print!

    Here’s the URL for my test case again: https://alanhogan.github.io/web-experiments/print_textarea.html

    Solutions:

    1. A JavaScript link that opens a new window and writes the contents of the textarea to it for printing. Or:

    2. When the textarea is updated, copy its contents to another element that that his hidden for screen but displayed when printed.

    3. (If your textarea is read-only, then a server-side solution is also workable.)

    Note that textareas treat whitespace differently than HTML does by default, so you should consider applying the CSS white-space: pre-wrap; in the new window you open or to your helper div, respectively. IE7 and older do not understand pre-wrap however, so if that is an issue, either accept it or use a workaround for them. or make the popup window actually plain text, literally served with a media type text/plain (which probably requires a server-side component).

    The “Print Helper” Solution (with code + demo)

    I have created a demo of one JavaScript technique.

    The core concept is copying the textarea contents to another print helper. Code follows.

    HTML:

    <textarea name="textarea" wrap="wrap" id="the_textarea">
    </textarea>
    <div id="print_helper"></div>
    

    CSS (all / non-print):

    /* Styles for all media */
    #print_helper {
      display: none;
    }
    

    CSS (print):

    /* Styles for print (include this after the above) */
    #print_helper { 
        display: block;
        overflow: visible;
        font-family: Menlo, "Deja Vu Sans Mono", "Bitstream Vera Sans Mono", Monaco, monospace;
        white-space: pre;
        white-space: pre-wrap;
    }
    #the_textarea {
      display: none;
    }
    

    Javascript (with jQuery):

    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
    <script type="text/javascript">
    jQuery(function($){
      function copy_to_print_helper(){
        $('#print_helper').text($('#the_textarea').val());
      }
      $('#the_textarea').bind('keydown keyup keypress cut copy past blur change', function(){
        copy_to_print_helper(); // consider debouncing this to avoid slowdowns!
      });
      copy_to_print_helper(); // on initial page load
    });
    </script>
    

    Again, the successful JavaScript-based demo is at https://alanhogan.github.io/web-experiments/print_textarea_js.html.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple HTML Form that allows the user to enter some text
I have a complicated form with some inputs and textareas that allow the user
We would like to be able to customize the areas outside the form elements
Using ASP.NET VB, I have a form with some text boxes and a Gridview.
I have a form with some generated input fields like theese: <input value=March name=month[March]
i have one form which have some input box and some select box. i
I have a form with a text area field. I put some text information
I have a form with a text area. Some people double-click on the submit
I would like to create a web form with something like a text area.
I have a form (with just one text area) that is submitted using AJAX

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.