1. #1
    Sencha User
    Join Date
    Jan 2009
    Posts
    11
    Vote Rating
    0
    Hector.Tafoya is on a distinguished road

      0  

    Question Unanswered: Removing number formatting from numberfield

    Unanswered: Removing number formatting from numberfield


    Hello,

    I want to place a textfield for the user to capture his phone number. As I want a numeric keypad to appear, I was looking to implement a numberfield.

    The first problem is that maxLength doesn't work, so I implemented a listener to overcome that.

    However my issue now is that on Safari Browser the numberfield formats automatically the resulting value with thousands separator.

    I guess that this behavior is because of the browser implementation of number imput, but is there any way to disable this formatting from sencha configurations?

    Thanks in advance.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,525
    Vote Rating
    871
    Answers
    3564
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    If you want special formatting then you could go with a textfield and prevent keys to be typed in a keydown listener stopping the event.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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 in print!

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

  3. #3
    Sencha User
    Join Date
    Jan 2009
    Posts
    11
    Vote Rating
    0
    Hector.Tafoya is on a distinguished road

      0  

    Default


    Hi mitchel,

    Thanks, the problem is that the formatting occurs when the textfield loses focus or when I use setValue().

Thread Participants: 1

Tags for this Thread