extjs 4 - How change default message error in field

extjs, extjs4.1, field

Solution

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!'
    }]

Problem

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

Original source

Related problems