This is a migrated thread and some comments may be shown as answers.

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

1 Answer 394 Views
NumericTextBox
This is a migrated thread and some comments may be shown as answers.
Tim R
Top achievements
Rank 1
Tim R asked on 05 Jun 2013, 01:57 PM
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?

Thanks

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 07 Jun 2013, 08:31 AM
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.

Regards,
Georgi Krustev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
NumericTextBox
Asked by
Tim R
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or