SensacionRC SensacionRC - 1 year ago 200
Javascript Question

ExtJS 4.2 two textfields in a form with same name

I have a form, and in the form there are two textfields with diferent itemIds but the same name, because when I call getForm().loadRecord(record) to fill the textfields in the form, only one is with data and the other is empty.

var form=new Ext.form.Panel({
xtype : 'textfield',
fieldLabel :'textfield1',
name : 'value1',
itemId : 'textfield1',
xtype : 'textfield',
fieldLabel :'textfield2',
name : 'value1',
itemId : 'textfield2'

The name property can only be used once in the same form to fill two diferent textfields with the same value from store?
I have search in the doc of sencha but didnĀ“t find anything about single use of name or unique name property.

Answer Source

Yes, the name property can only be used once in the same form. You can set value of second field by using

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download