[ADDED] [V0.7.0] TextField MaxLength

  1. #1

    [ADDED] [V0.7.0] TextField MaxLength

    Hello,

    Just a general question, I can't seem to find anything on this, but have you guys come across a way that the MaxLength attribute of the TextField can hard stop as opposed to allowing you to continue to type and showing a validation message??

    It's a little annoying if it shows a message but I'm using AutoPostBack="True" on my Button that allows the invalid to go through.

    Cheers,
    Timothy
  2. #2

    RE: [ADDED] [V0.7.0] TextField MaxLength

    Any suggestions?

    Cheers
  3. #3

    RE: [ADDED] [V0.7.0] TextField MaxLength

    It comes down to a differing philosophy of ExtJS where the belief is to not truncate, which would allow the pasting of a larger string into the TextField without auto chopping the string.

    Obviously there are scenarios where that methodology may not be appropriate (or wanted) so the choice should be left up to the developer.*


    We're working on a solution.


    Geoffrey McGill
    Founder
  4. #4

    RE: [ADDED] [V0.7.0] TextField MaxLength

    Hello Geoffrey,

    Just checking for an update on the above?

    Cheers,
    Timothy
  5. #5

    RE: [ADDED] [V0.7.0] TextField MaxLength



    Hi Timothy,

    We have added a new .Truncate [default=true] property to TextFieldBase.cs.

    If the .MaxLength property is set, a TextField will now automatically truncate the text to the MaxLength.

    The default functionality of the MaxLength property is to now truncate the value.

    If you wish to allow more characters than MaxLength and have the TextField render a Validation message, then please set Truncate="false". The following example demonstrates setting the MaxLength and Truncate properties.

    Example

    <ext:TextField ID="TextField1" runat="server" MaxLength="4" />
    
    <ext:TextField ID="TextField2" runat="server" MaxLength="4" Truncate="false" />
    The new code has been committed to SVN and will be publicly available with the next official release.

    Hope this helps.

    P.s. Moved thread to "Feature Requests" from "Premium Help".
    Geoffrey McGill
    Founder
  6. #6

    RE: [ADDED] [V0.7.0] TextField MaxLength

    Great, thanks so much Geoffrey!

    Sorry I haven't been around lately, work. I will be checking out the latest code tomorrow and testing things.

    Cheers,
    Timothy

Similar Threads

  1. issue about maxlength of TextField
    By sonnh11 in forum 1.x Help
    Replies: 4
    Last Post: Jan 07, 2013, 6:33 AM
  2. TextField MaxLength not working
    By xtremexploit in forum 2.x Help
    Replies: 1
    Last Post: Jun 18, 2012, 11:28 PM
  3. [CLOSED] TextField - Maxlength
    By rnfigueira in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: May 17, 2011, 6:20 PM
  4. change textfield maxlength
    By [WP]joju in forum 1.x Help
    Replies: 1
    Last Post: Sep 24, 2009, 4:51 AM
  5. MaxLength validation in TextField & NumericField
    By madhugumma in forum 1.x Help
    Replies: 0
    Last Post: Aug 06, 2009, 4:46 AM

Posting Permissions