Reputation: 8498
I have one extjs number field. I can enter numbers 0-9 and dot(.) in it. How can I avoid this dot also. I need only integers. Plase give me the required regex.
Upvotes: 4
Views: 2907
Reputation: 20047
There is actually a config property on a numberfield
to do that, so you can just specify the field like this:
{
xtype: 'numberfield',
allowDecimals: false
}
Upvotes: 8
Reputation:
/^\d+$/
is the regex you requested.
If you need to capture it, try /^(\d+)$/
Upvotes: 2