I have a form panel in http://jsfiddle.net/7CLWy/ here is my important code
items: [{
xtype: 'textfield',
fieldLabel: 'First Name',
allowBlank: false,
msgTarget: 'under',
name: 'firstName'
}, {
xtype: 'datefield',
allowBlank: false,
fieldLabel: 'Start date',
msgTarget: 'under'
}],
I want change default message error in field
How to change that. Thanks
The blankText
property is the validation message when a field is required, and invalidText
is the text when the field generically fails validation. You can add your own custom messages in these properties. Similarly, if you happened to be doing regex-based validation with the regex
property, you could use the regexText
field to provide a custom validation message.
items: [{
xtype: 'textfield',
fieldLabel: 'First Name',
allowBlank: false,
msgTarget: 'under',
name: 'firstName',
blankText: 'This should not be blank!'
}, {
xtype: 'datefield',
allowBlank: false,
fieldLabel: 'Start date',
msgTarget: 'under',
invalidText: 'This value is not a valid date!'
}, {
xtype: 'textfield',
fieldLabel: 'Digits followed by A,B,or C',
msgTarget: 'under',
name: 'someText',
regex: /^\d+[ABC]$/,
regexText: 'This must be a string of digits followed by A, B, or C!'
}]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With