Results 1 to 3 of 3

Thread: NumberField with leading zeros

  1. #1
    Sencha User
    Join Date
    Sep 2008
    Posts
    85

    Default Answered: NumberField with leading zeros

    I have a form with a numberfield where the user will enter a 6 digit code. The valid value are 1 - 999999 and the user must enter 6 digits. For example: 123456, 987600 or 000123. This last example is where I am having problems. When the user leaves the field after entering 000123 the numberfield automatically changes the value to 123 which is NOT valid for this field. How do I configure the numberfield to not remove the leading zeros? I know I could roll my own field starting wtih a textfield and handling the key events, but this should be something numberfield should support via a config option as leading zeros are valid numbers.

  2. There's a user extension available that should solve what you're looking for: https://gist.github.com/gregawoods/5977728 This functionality isn't available within Ext.form.field.Number though.


  3. #2
    Sencha - Sustaining Engineer tristan.lee's Avatar
    Join Date
    Mar 2015
    Location
    Central Ohio
    Posts
    1,579
    Answers
    165

    Default

    There's a user extension available that should solve what you're looking for: https://gist.github.com/gregawoods/5977728 This functionality isn't available within Ext.form.field.Number though.

    Tristan Lee
    Sencha Inc - Sustaining Engineer


    Having an issue? Help us help you - be detailed; provide some code; demonstrate with a fiddle (fiddle.sencha.com)

    Embed your fiddle in your post: [FIDDLE]id[/FIDDLE]

  4. #3
    Sencha User
    Join Date
    Sep 2008
    Posts
    85

    Default

    Thanks

Similar Threads

  1. Replies: 1
    Last Post: 18 Feb 2015, 3:49 PM
  2. Replies: 4
    Last Post: 19 Aug 2013, 2:59 PM
  3. Replies: 2
    Last Post: 15 Jul 2012, 2:28 PM
  4. Ext.Date.parseDate vs. leading zeros
    By Vasiliy Faronov in forum Ext: Discussion
    Replies: 0
    Last Post: 11 Jul 2012, 6:51 AM

Posting Permissions

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