I have textfield:
{
xtype : 'textfield',
id: 'specialCode',
allowBlank: true,
fieldLabel : 'Special Code',
name : 'specialCode'
}
I do make it required when a checkbox is checked with
Ext.getCmp('specialCode').allowBlank = false;
Ext.getCmp('specialCode').validateValue(Ext.getCmp('specialCode').getValue());
I bees red and it bees required.
Then when another checkbox is cheked I use this code
Ext.getCmp('specialCode').allowBlank = true;
It bees not required but the red border does not go away. I need to click the field and some other place in order to remove the red border.
I have textfield:
{
xtype : 'textfield',
id: 'specialCode',
allowBlank: true,
fieldLabel : 'Special Code',
name : 'specialCode'
}
I do make it required when a checkbox is checked with
Ext.getCmp('specialCode').allowBlank = false;
Ext.getCmp('specialCode').validateValue(Ext.getCmp('specialCode').getValue());
I bees red and it bees required.
Then when another checkbox is cheked I use this code
Ext.getCmp('specialCode').allowBlank = true;
It bees not required but the red border does not go away. I need to click the field and some other place in order to remove the red border.
Share Improve this question edited Sep 12, 2011 at 7:25 ilhan asked Sep 12, 2011 at 7:19 ilhanilhan 8,99535 gold badges127 silver badges214 bronze badges1 Answer
Reset to default 8use clearInvalid
on the field too to reset it's invalidation style.
Ext.getCmp('specialCode').allowBlank = true;
Ext.getCmp('specialCode').clearInvalid();