Menu

"MaxLength" not working

Help
Albert
2012-03-23
2012-09-19
  • Albert

    Albert - 2012-03-23

    The "MaxLength" function not working.

    <asp:TextBox id="txtEntidad" runat="server" Width="35px" MaxLength="4" pattern="*"/>

    What I do?

    Albert

     
  • Albert

    Albert - 2012-03-23

    Not working in mobile device (iPhone, Android)

    What can I do?

    Albert

     
  • Jason Akin

    Jason Akin - 2012-03-26

    This is actually from the HTML5
    spec
    .

    "If the value of the type attribute is text, email, search, password, tel, or
    url, this attribute specifies the maximum number of characters (in Unicode
    code points) that the user can enter; for other control types, it is ignored.
    It can exceed the value of the size attribute. "

    It looks like Firefox and IE supports MaxLength despite the spec.

    You can use the min and max values to limit it for example, max="9999". They
    can enter more digits, but the control will register as having an invalid
    value. Check it out here: look at the
    first Number input with the placeholder text: "Enter a Number"

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.