3

When i submit my form and I try to get value in php server like

$_POST['dis']

But that's undefined. I make a example of my problem in http://jsfiddle.net/LVBGr/

Here is my code

items: [{
    labelAlign : 'right',
    labelWidth: 72,
    width:300,
    xtype: 'displayfield',
    fieldLabel: 'How to get',
    name: 'dis',
    value: 'Hello'
}],
buttons: [{
    text: 'Submit',
    handler: function () {
        var form = this.up('form').getForm();
        var values = form.getValues();
        alert(values['dis']); // undefinded
    }
}]

How to get value in xtype: displayfield thanks

4

1 回答 1

8

默认情况下displayfield配置为不提交任何值。您可以通过在配置中指定来更改此submitValue: true设置。

于 2013-07-28T11:39:24.820 回答