PDA

View Full Version : How to allow only single numeric value in TextField?



dbassett74
19 Aug 2010, 8:42 AM
I'm having a bit of a problem with this. I have tried the following:



maskRe: new RegExp(/^\d{1}$/),
maxLength: 1,


It correctly only allows digits to be entered, but how do I only allow a single digit? It seems the maxLength is not a "hard" max. I want to prevent more than one digit all together.

Thanks.

Condor
19 Aug 2010, 11:22 AM
autoCreate: Ext.apply({maxlength: '1'}, Ext.form.Field.prototype.defaultAutoCreate)

dbassett74
19 Aug 2010, 12:11 PM
That done did her!