PDA

View Full Version : Read the values from a form



Kapfe89
25 Nov 2009, 5:17 AM
Hi,

i try to give out the value from a Ext.Window,
and it writes "default value". But also when i change the "default value" to something else,
document.write writes the "default value" down. How can i change this?


var w = new Ext.Window({
heigth: 100,
width: 300,
title: 'title...',
layout: 'form',
items: [
{xtype: 'textfield',
fieldLabel: 'name',
id: 'name',
name: 'name',
value: 'default value'
},
{xtype: 'datefield',
fieldLabel: 'date',
name: 'date'
}
],
buttons: [
{
text: 'Save',
handler: function() {
document.write(w.get('name').value);
}
}

]
});Thank you for your help!

Regards,
Martin

jay@moduscreate.com
25 Nov 2009, 6:39 AM
Technically, it's a div with form elements, not a form.

that said, you can access them via items.

or you can set an 'itemId' to them, and use w.getComponent('someItemId').setValue('some new value')

Kapfe89
25 Nov 2009, 8:26 AM
Great, it works.

Thanks.