---
title: "How to get data from fieldset in Sencha Touch 2?"  
description: "How to get data from fieldset in Sencha Touch 2?"  
author: "Anonymous User"  
published: 2013-05-31  
updated: 2013-06-01  
canonical: https://www.mindstick.com/forum/954/how-to-get-data-from-fieldset-in-sencha-touch-2  
category: "sencha touch"  
tags: ["sencha touch"]  
reading_time: 2 minutes  

---

# How to get data from fieldset in Sencha Touch 2?

Hi [Expert](https://www.mindstick.com/articles/13120/an-expert-financial-advice-will-improve-your-finances)!\
I hava a fieldset in [Sencha Touch](https://www.mindstick.com/interview/23004/define-class-system-of-sencha-touch) 2 as follows:{ id:'contactForm', xtype: 'fieldset', title: 'Information', items: [ { xtype: 'textfield', label: 'First Name', [placeHolder](https://www.mindstick.com/forum/1519/how-do-i-remove-a-listbox-new-item-placeholder): 'Your First Name', name:'[firstName](https://www.mindstick.com/interview/33973/how-to-split-the-full-name-into-firstname-and-lastname-in-sql-server)', id:'firstName', }, { xtype: 'textfield', label: 'Last Name', placeHolder: 'Your Last Name', name:'lastName' }, { xtype: 'emailfield', label: 'Email', placeHolder: 'email@example.com' }, { xtype: '[button](https://www.mindstick.com/articles/63/how-to-add-button-in-datagridview-in-csharp-dot-net)', height: 37, style: 'margin-left:35%', width: 100, iconAlign: 'center', text: 'Submit', action:'ContactSubmit' }, { xtype: 'hiddenfield', id: 'HNumberOfBedRoom', value:'2' }, { xtype: 'hiddenfield', id: 'HPetFriendlyId', value:'2' } ]}\
In my [controller](https://www.mindstick.com/blog/273/passing-values-from-controller-to-view-in-asp-dot-net-mvc), I have the following:refs: { contactForm: '#contactForm' }\
I can retrive the value by using\
var frmItems=this.getContactForm().getItems();console.log(frmItems.items[1]._value);\
This [works fine](https://answers.mindstick.com/qa/115732/my-software-works-fine-on-windows-10-but-crashes-on-windows-11-why) but i want to [retrieve](https://www.mindstick.com/forum/34400/how-to-retrieve-form-values-in-controller-action) the values something like\
frm.get('name/id of [component](https://www.mindstick.com/articles/12262/learn-how-to-make-a-component-in-magento-2)')\
Is there any way to achieve this?\
Thanks in [advance](https://www.mindstick.com/blog/33258/jee-mains-and-jee-advance-exams)! \

## Replies

### Reply by AVADHESH PATEL

Hi Everyone!\
Use a Ext.form.Panel as your primary container.\
example snippet\
Ext.define('App.view.ContactForm',{ extend : 'Ext.form.Panel', xtype : 'contactform', id : 'contactForm', config : { items : [ { xtype : 'fieldset', items : [ { { xtype: 'textfield', label: 'First Name', placeHolder: 'Your First Name', name:'firstName', }, ] }});in your controller\
refs : { contactForm : '#contactForm' }\
then in your function you can either do\
this.getContactForm().getValues().firstName(uses the name value of the field)\
or\
var vals = this.getContactForm().getValues();vals.firstName;Avoid using Ext.getCmp() or a flat Ext.get() at the top level if you absolutely can help it. If you're building custom controls you might have to make use of those, \
otherwise you're making things too hard on yourself.


---

Original Source: https://www.mindstick.com/forum/954/how-to-get-data-from-fieldset-in-sencha-touch-2

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
