[ExtJs4.0]根據一個文本框輸入的內容自動填寫到另外一個文本框內

一個增加數,一個減少數,隨便輸入其中一個另外一個都會自動輸入

{

            xtype: 'textfield',

            id: 'IncreaseId',

            fieldLabel: '?¨®ºy<span style="color: red;" >*</span>',

            regex: /^[0-9]*$/,

            regexText: '?º?¨??ºy',

            width: 400,

            name: 'IncreaseNumber',

            allowBlank: false,

            maxLength: 10,

            maxLengthText: 'º?¨?y¡è',

            onBlur: function () {

                var thisForm = this.up('form');

                var increaseNumberValue = thisForm.getForm().findField('IncreaseId').getValue();

                thisForm.getForm().findField('ReduceId').setValue(increaseNumberValue);

            }

        }

, {

            xtype: 'textfield',

            fieldLabel: '?¦¨´ºy<span style="color: red;" >*</span>',

            id: 'ReduceId',

            regex: /^[0-9]*$/,

            regexText: '?º?¨??ºy',

            width: 400,

            name: 'ReduceNumber',

            allowBlank: false,

            maxLength: 10,

            maxLengthText: 'º?¨?y¡è',

            onBlur: function () {

                var thisForm = this.up('form');

                var reduceNumberValue = thisForm.getForm().findField('ReduceId').getValue();

                thisForm.getForm().findField('IncreaseId').setValue(reduceNumberValue);

            }

        },

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章