can NumericTextBox be used with USA 5-digit zipcodes (actually a string of digits not a number) that can begin with leading zero?

2 posts, 0 answers
  1. Tim R
    Tim R avatar
    131 posts
    Member since:
    Feb 2006

    Posted 05 Jun 2013 Link to this post

    US zipcodes come in two varieties, a 5-digit code (e.g. "90210") and a 5-digit-hyphen-4-digit code (e.g. "19063-2345").   I am interested in the former.  

    Both formats can begin with a leading zero, e.g. Princeton NJ zipcode is "08540".

    Can the NumericTextBox  be made to preserve the leading zero, and to display the value as a string of five digits without commas, decimal points?

    I'm looking to adapt the NumericTextBox into a masked text box that accepts a string of five digits.
    Does KendoUI have a masked text box that I've overlooked?

  2. Georgi Krustev
    Georgi Krustev avatar
    3687 posts

    Posted 07 Jun 2013 Link to this post

    Hello Tim,

    In general, the NumericTextBox widget is not designed to support such behavior. When user focus the widget, its Number value will be converted to string and put into the input element. As you probably know, the Number object does not perists the leading zeros. Basically, you can accomplish something like this using the NumericTextBox.

    Georgi Krustev
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top