Getting values from a form using xtype:formpanel
Hi,
I've trying to create a TabPanel which includes a FormPanel and a Fieldset and then retrieve the values using a button.
All is working great - but I can't get the values from the form.
Please help :)
Here is the code
Code:
Ext.create('Ext.TabPanel', { fullscreen: true,
tabBarPosition: 'bottom',
items: [
{
xtype: 'formpanel',
iconCls: 'home',
name: 'loginform',
id: 'loginform',
title: 'Home',
standardSubmit: false,
items: [
{
xtype: 'fieldset',
title: 'Login',
items: [
{
xtype: 'emailfield',
name: 'email',
label: 'Email'
},
{
xtype: 'passwordfield',
name: 'password',
label: 'Password'
}
]
},
{
xtype: 'button',
width: '50%',
align: 'center',
text: 'Login',
ui: 'confirm',
handler: function () {
var values = loginform.getValues();
alert('Email' + values['email']);
}
}
]
},
{
title: 'Exercises',
iconCls: 'search',
html: ['Exercises'].join(""),
style: 'text-align: center;'
},
{
xtype: 'toolbar',
docked: 'top',
title: 'LMobile'
}
]
});
Thank you!