cheftao
cheftao

Reputation: 179

Allow only positive value in numberfield extjs

How can I limit the value in numberfield to be positive only (0 not included) without using a validator.

Upvotes: 2

Views: 6983

Answers (1)

Nareshdhar Dwivedi
Nareshdhar Dwivedi

Reputation: 643

Use this, it works for me.

new Ext.form.NumberField({
    id: 'port',
    fieldLabel: 'Port',
    name: 'port',
    allowNegative: false,
    allowBlank: false,
    minValue: 1,
    anchor: '90%',
    allowDecimals: false
})

Upvotes: 5

Related Questions