Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extjs 4.1 Submit Form - How to get value in xtype: displayfield

Tags:

extjs

extjs4.1

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

like image 572
LookAtMeNow Avatar asked Nov 19 '25 13:11

LookAtMeNow


1 Answers

The displayfield is configured by default to not submit any value. You can change this by specifying submitValue: true in the configuration.

like image 102
Evan Trimboli Avatar answered Nov 21 '25 03:11

Evan Trimboli



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!