View Full Version : Restricting input on textfield - behaviour is different between IE and FF

2 Mar 2010, 11:52 AM
I am trying to allow the user to enter only numeric values to a textfield (may allow symbols later which is why NumberField is not used). The following piece of code works fine on FF, but on IE, the field also allows special characters such as '"-%$ to be entered. Does anyone know what is wrong and what is the best way to resolve it? Thanks.

xtype: 'textfield',
maskRe:new RegExp('[0-9]+'),
validator: function(v) {
return (new RegExp('[0-9]+')).test(v)? true : 'Invalid Format!';