2 Dec 2011 8:26 AM #1
Answered: Text Field set valid on function. Need to overwrite Ext invalid state
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.
fieldLabel: 'first name',
allowBlank: false // requires a non-empty value
(Section of function mentioned)
var firstNameEntry = Ext.getCmp("firstName");
firstNameEntry.setValid() //TODO ?? I know this is incorrect EXT/JS and am trying to resolve this
To clear the invalid state, execute the clearInvalid() method on the field.
2 Dec 2011 8:36 AM #2
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
To clear the invalid state, execute the clearInvalid() method on the field.Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Software Engineer
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services email@example.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!
When posting code, please use BBCode's CODE tags.
2 Dec 2011 8:38 AM #3
Thank you very much... perfect answer
Thank you very much... quite embarrassed I couldn't find that myself in API's.