PDA

View Full Version : Submitting form using itemId instead of id



Asken
12 Jul 2010, 4:52 AM
Can I submit the form using itemId instead of name? I have several tabs with the same information but the name is tagged using an Id to make it unique but the backend is expecting the post key excluding the tag.

Do I have to make my own request to make this happen or can I do it someother way?



...},{
xtype:'textfield',
fieldLabel:'Name',
name:'f_name_'+data.Feed_ID,
itemId:'f_name',
value:data.Name,
anchor:'-15',
allowBlank:false
},{...
I want to send

params: { f_name: value }rather than

params: { f_name_2: value }

Condor
12 Jul 2010, 4:56 AM
You will have to do your own request in that case.

Have a look at how BasicForm.getFieldValues collects the values of the fields. You will have to write a similar function that collects the field values indexed by itemId instead of name.

Asken
12 Jul 2010, 4:57 AM
Never mind... figured it out. I was using the name instead of the id for uniqueness...


...},{
xtype:'textfield',
fieldLabel:'Name',
id:'f_name_'+data.Feed_ID, // id instead of name
name:'f_name', // name instead of itemId
value:data.Name,
anchor:'-15',
allowBlank:false
},{...

Asken
12 Jul 2010, 4:58 AM
Thanks Condor...