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

  • Home
  • SEARCH
  • 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 4621196
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:39:56+00:00 2026-05-22T02:39:56+00:00

I am trying detect when a textarea becomes full for creating pagination effect. Using

  • 0

I am trying detect when a textarea becomes full for creating pagination effect. Using the .length property will not work, however, because long words ‘jump’ to new lines.

| I like to dooo|     displays as  | I like to     | 
| oooodle       |                  | dooooooodle   |

So what ends up happening is that the textarea always runs out of space before the .length property reaches the textarea limit. Is there any other way to detect textarea fullness? Jquery solutions are fine as well. Thanks.

  • 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-22T02:39:57+00:00Added an answer on May 22, 2026 at 2:39 am

    You can try to check if scrollbars have appeared in your textarea. Here is a simple way to do this. Initially make the scrollbar one line shorter than the ultimate height you want to show, then on keypress check if scrollbars have appeared, then wait for the next space char to be entered. As soon as space char is entered do the following:
    1. delete the space char,
    2. increase the textarea height one line linger (so scrollbar disappears),
    3. create a new textarea and move focus to the new textarea.

    Update
    Here is a demo. I changed my method a bit and this is the code:

    Markup

    <textarea class="paginate"></textarea>
    

    JS

    $('textarea.paginate').live('keydown', function() {
    
        // scrollbars apreared
        if (this.clientHeight < this.scrollHeight) {
    
            var words = $(this).val().split(' ');
            var last_word = words.pop();
            var reduced = words.join(' ');
            $(this).val(reduced);
            $(this).css('height', '65px');
    
            $(this).after('<textarea class="paginate"></textarea>');
            $(this).next().focus().val(last_word);
    
        }
    
    });
    

    CSS

    .paginate { height: 60px; width: 200px; display: block;}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to detect if files property is supported in DataTransfer Object using Javascript. The
I'm trying to figure out a way to detect files that are not opened
Trying to detect when a user clicks Cancel but the $_POST on using var_export($_POST)
I'm trying to detect which version .NET is installed using WiX. I've tried: <Condition
I'm trying to detect the speed of touch movement and i'm not always getting
I am trying to detect touches, but the touchesBegan method is not being called.
hey i am trying to detect leaks in visual studio using : #define _CRTDBG_MAPALLOC
I'm trying to detect a swinging motion with an iPhone 4 using the gyro/accelerometer.
I am trying to detect whether an integer was set, and if not, skip
I'm trying to detect pinch using multitouch in onTouchEvent of the activity. But the

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.