PDA

View Full Version : get content of textfield



bauchinj
1 Nov 2009, 11:49 PM
Hello!

Just a short message, but I can't find it in documentation:

I'd like to get the content just of one textfield:


xtype : 'form',
id : 'formUA',
width : 50,
border : false,
items : [{
xtype : 'textfield',
fieldLabel : 'Username',
name : 'username',
id : 'username',
width : 200
},{
xtype : 'textfield',
fieldLabel : 'Password',
inputType : 'password',
name : 'password',
width : 200
},{
xtype : 'textfield',
fieldLabel : 'Firstname',
name : 'firstname',
width : 200
},{
xtype : 'textfield',
fieldLabel : 'Lastname',
name : 'lastname',
width : 200
}]
});
Ext.getCmp("formUA").getForm().load({
url : 'php/abc.php',
params : {
action : 'User',
id : user
}
});

Now I'd like to know the content of 'username':

with Ext.getCmp('formUA'); I'm able to get the form, but how to get the username???

tubamanu
1 Nov 2009, 11:50 PM
Ext.getCmp('username').getValue();

bauchinj
1 Nov 2009, 11:58 PM
Thank you, I know it's not complicated...