Results 1 to 3 of 3

Thread: How to change textfield maxLength ( dynamically)

  1. #1
    Sencha User
    Join Date
    Oct 2009
    Location
    rome - italy
    Posts
    38
    Vote Rating
    0
      0  

    Default How to change textfield maxLength ( dynamically)

    Is it possible to change dynamically texfield's maxLegth !?!?!Thanks a lot

  2. #2
    Sencha User friend's Avatar
    Join Date
    Apr 2011
    Posts
    895
    Answers
    106
    Vote Rating
    27
      0  

    Default

    You can manually modify a field's maxLength property at any time and it will be respected by the field validation rules. However, this does nothing to the physical length of the input field and doesn't stop a user from entering a longer value than desired; it only affects the validation rule on the field and causes it to turn red if too many characters are entered.

    If you're also using enforceMaxLength, the enforcement of string length is actually set in DOM attributes when the component is rendered, so again, dynamically modifying the maxLength property won't have the desire effect.

  3. #3
    Sencha User
    Join Date
    May 2010
    Location
    Kiev, Ukraine
    Posts
    156
    Answers
    15
    Vote Rating
    9
      0  

    Default

    Try update textfield.inputEl.dom.maxLength
    Demo here http://ext4all.com/post/how-to-dynam...ield-maxlength
    Vitaliy Khmurach
    Web Developer
    https://ext4all.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •