1. #1
    Sencha User sneyder05's Avatar
    Join Date
    Apr 2012
    Location
    Cali, Colombia
    Posts
    3
    Vote Rating
    0
    sneyder05 is on a distinguished road

      0  

    Default Answered: Component numberfield not works property 'maxLength'

    Answered: Component numberfield not works property 'maxLength'


    I have the following code, but not works:<br>

    PHP Code:
    {
       
    xtype'numberfield',
       
    label'Cantidad'
       
    maxLength5,
       
    stepValue1,
       
    placeholder'0',
       
    clearIconfalse,
       
    labelWidth85

    The <input/> allow more than 5 characters, why?
    {
    ___status: 200,
    ___job: 'freelancer',
    ___contact: 'fabiansneyder@gmail.com',
    ___webmaster: true
    }

  2. Looks like <input> with type = 'number' does not support maxlength attribute.

    Some tests I did without Sencha Touch involved was this:

    Code:
    <input type="text" maxlength="5" />
    typed 12345 and would not allow more as expected.

    Code:
    <input type="number" maxlength="5" />
    typed 12345 but could type more. This shows that the HTML5 spec for number type does not adhere to maxlength.

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,656
    Vote Rating
    435
    Answers
    3108
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    Looks like <input> with type = 'number' does not support maxlength attribute.

    Some tests I did without Sencha Touch involved was this:

    Code:
    <input type="text" maxlength="5" />
    typed 12345 and would not allow more as expected.

    Code:
    <input type="number" maxlength="5" />
    typed 12345 but could type more. This shows that the HTML5 spec for number type does not adhere to maxlength.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.

  4. #3
    Sencha User sneyder05's Avatar
    Join Date
    Apr 2012
    Location
    Cali, Colombia
    Posts
    3
    Vote Rating
    0
    sneyder05 is on a distinguished road

      0  

    Default


    Thank You very much @mitchellsimoens


    I think the solution will be using the keyup event
    {
    ___status: 200,
    ___job: 'freelancer',
    ___contact: 'fabiansneyder@gmail.com',
    ___webmaster: true
    }

  5. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,656
    Vote Rating
    435
    Answers
    3108
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    btw, love your sig
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.