Answered: Text Field set valid on function. Need to overwrite Ext invalid state
Answered: Text Field set valid on function. Need to overwrite Ext invalid state
Dear all,
First time posting, but have looked at previous examples and googled a lot so please be kind!
I am trying to reset the contents of a form inside which are some textfields which by default need to have allowBlank: false set on them. When the form contents are set to empty string "" the textfield obviously validates that the content of the textfield is false. I want to set the validation at this point to be overwritten to be true at this state, before continuing with normal behaviour once a user enters data into the box again.
Basically I just need to reset the validation and content of the form back to it's default state before text is entered by the user.
(TextField mentioned)
{
xtype: 'textfield',
name: 'firstName',
id:"firstName",
fieldLabel: 'first name',
width:entryPanelWidth,
allowBlank: false // requires a non-empty value
}
(Section of function mentioned)
var firstNameEntry = Ext.getCmp("firstName");
firstNameEntry.setValue("")
firstNameEntry.setValid() //TODO ?? I know this is incorrect EXT/JS and am trying to resolve this