PDA

View Full Version : Grouping Values In Form



topherfangio
23 Aug 2011, 5:51 AM
Hi all,

I have a FormPanel with a bunch of dynamically created form elements (textfields, checkboxes, etc.). This is working great, and when I call form.getValues() it returns all of the elements. However, I'd like to group some of them so that instead of returning



{
'question_1':[1,2,3],
'question_2':[3,4,5],
'form_id':16
}


I'd like to return



{
'questions':{
1:[1,2,3],
2:[3,4,5]
},
'form_id':16
}


Basically, is there a way to group the field elements so that getValues() returns them nicely? I've tried the standard html way of specifying the name as "questions[1]", but that doesn't seem to do anything special.

Thanks very much for the help!