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 8329109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:39:44+00:00 2026-06-09T01:39:44+00:00

Jelly Bean doesn’t seem to like the maxlength attribute of HTML for text input.

  • 0

Jelly Bean doesn’t seem to like the maxlength attribute of HTML for text input. It certainly restricts the number of input characters but the moment you attempt to type beyond the allowed number of character, the text box fails. Now you won’t be able to type in any other text boxes and nor will you be able to delete the already input character, in that text box.

If you haven’t already faced this, then try it yourself on a simple HTML and check. Please tell me if you have any clue for solving this.

  • 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-06-09T01:39:46+00:00Added an answer on June 9, 2026 at 1:39 am

    I have also experienced the same problem in my app

    for now I have handled it with js, which removes all maxlength attributes from input text and textarea and stops user from inputing more than the required text. Here it is assumed that all input text and textarea have unique id.

    Code is also available at jsfiddle

        $(document).ready(function () {
    
            var ver = window.navigator.appVersion;
                ver = ver.toLowerCase();
    
            if ( ver.indexOf("android 4.1") >= 0 ){            
    
                var idMaxLengthMap = {};
    
                //loop through all input-text and textarea element
                $.each($(':text, textarea, :password'), function () {
                    var id = $(this).attr('id'),
                        maxlength = $(this).attr('maxlength');
    
                    //element should have id and maxlength attribute
                    if ((typeof id !== 'undefined') && (typeof maxlength !== 'undefined')) {
                        idMaxLengthMap[id] = maxlength;
    
                        //remove maxlength attribute from element
                        $(this).removeAttr('maxlength');
    
                        //replace maxlength attribute with onkeypress event
                        $(this).attr('onkeypress','if(this.value.length >= maxlength ) return false;');
                    }
                });
    
                //bind onchange & onkeyup events
                //This events prevents user from pasting text with length more then maxlength
                $(':text, textarea, :password').bind('change keyup', function () {
                    var id = $(this).attr('id'),
                        maxlength = '';
                    if (typeof id !== 'undefined' && idMaxLengthMap.hasOwnProperty(id)) {
                        maxlength = idMaxLengthMap[id];
                        if ($(this).val().length > maxlength) {
    
                            //remove extra text which is more then maxlength
                            $(this).val($(this).val().slice(0, maxlength));
                        }
                    }
                });
            }
        });​
    

    The bug for this issue was already opened at 35264

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

Sidebar

Related Questions

I am looking for image animation like jelly in android. As I am newbie
I had a user just install 4.1 (jelly bean), and the ListView onItemClick() stopped
I am using Galaxy nexus with Jelly bean and i have noticed that logcat
We have a Jelly Bean Galaxy Nexus from Google IO, and have all the
I am testing my app in the new Android system 4.1 Jelly Bean ,
I am looking for how we change the vibrate settings in Jelly Bean. I
Jelly Bean has removed the ability to read the logs of other apps (according
Jelly Bean has come out and they have some pretty nice features. My question
I have been scouring Jelly Bean to see if I could find the Offline
I have tweaked the standard jelly template to display the current test results in

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.