PDA

View Full Version : Using Radio Buttons with getFieldValues



primary0
14 Mar 2011, 10:19 PM
I'm having trouble submitting radio button values. I have two radio buttons set up like this:



{
xtype: 'radio',
fieldLabel: 'Employment Type',
boxLabel: 'Documented',
name: 'employment_type',
checked: true,
inputValue: 'documented'
},
{
xtype: 'radio',
boxLabel: 'Contracted',
name: 'employment_type',
inputValue: 'contracted'
}


I am submitting the form this way using an AJAX call.



var myParams = {
employee: form.getFieldValues()
}

Ext.Ajax.request({
url: '/employees',
jsonData: myParams,
success: function(result, request){
...


In the server console I see the parameter passed as shown below, which is wrong.



"employment_type"=>[false, true]


How I'd like to have the parameter passed:



"employment_type"=>"documented"