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

[Solved] CurrencyTextBox allows invalid characters

1 Answer 23 Views
NumericTextBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Adam
Top achievements
Rank 1
Adam asked on 30 Aug 2011, 04:53 PM
I am currently using a CurrencyTextBox that is bound to a model and when the page renders it is allowing input of the following characters: #, %, &, and (.

These characters map to the keycodes 35, 37, 38, and 40 respectively.  They don't seem like valid characters that would be allowed in a currency box or most of the other numeric text boxes (except for the %).  From tracing through the code I believe the problem is in the _keypress function in the telerik.textbox.js file.  It is just checking the keycodes for the home, end, left arrow, right arrow, etc. and not checking the modifier keys.

Can anyone confirm this?  I am seeing the same results on the MVC Numeric Text Box demo page as well.

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 31 Aug 2011, 10:14 AM
Hello Adam,

 
This behavior is by default. Some keyboard layouts (in particular Slovak QWERTZ keyboard layout) allows to type numbers only with pressed Shift button. That is why we decide to allow Shift + number key combination. 

Regards,
Georgi Krustev
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
NumericTextBox
Asked by
Adam
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or