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

Numeric Textbox cuts off 0

3 Answers 177 Views
Input
This is a migrated thread and some comments may be shown as answers.
Maria
Top achievements
Rank 1
Maria asked on 17 Dec 2008, 04:58 PM
Hello,

I am using numeric textbox for entering account number that can start from 000
The control cuts off leading zeros. Is there any way I can get the number a customer enters?

Thank you.

3 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 17 Dec 2008, 05:04 PM
Hi Maria,

RadNumericTextBox is for numbers only. 0009321 is a formatted string. Please use RadMaskedTextBox if you want to preserve leading zeros. Here is an example:

http://demos.telerik.com/aspnet-ajax/Input/Examples/RadMaskedTextBox/DisplayFormat/DefaultCS.aspx

Regards,
Dimo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Maria
Top achievements
Rank 1
answered on 17 Dec 2008, 05:20 PM
Dear Dimo,

Thank you very much for quick response.
However, I don't know the lenght of the account number.
How would I set up the mask for it?

Thank you.
0
Dimo
Telerik team
answered on 17 Dec 2008, 05:35 PM
Hi Maria,

In this case you can use a RadTextBox and impose a numeric constraint. Please try the approach described here:

http://www.telerik.com/community/forums/aspnet/input/radtextbox-accept-only-alphabetic.aspx

The only thing you need to change is the regular expression. It should be:

/^[0-9]$/

instead of

/^[a-zA-Z_]$/


Greetings,
Dimo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Input
Asked by
Maria
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Maria
Top achievements
Rank 1
Share this question
or