PDA

View Full Version : How to get the selected value from radio group



samith143
4 May 2009, 2:18 AM
Hi,
how can i get the selected value from radio group. following is my radio group.



{
xtype: 'radiogroup',
fieldLabel: '<font color="red">* </font>Allow Credit',
width:130,
items: [
{boxLabel: 'YES', name: 'rb-allow-credit', inputValue: 1},
{boxLabel: 'NO', name: 'rb-allow-credit', inputValue: 2, checked: true}
]
}



thanks

4 May 2009, 2:59 AM
if i'm not mistaking, Ext.getCmp('yourRadioGroup').getValue()

Condor
4 May 2009, 3:01 AM
if i'm not mistaking, Ext.getCmp('yourRadioGroup').getValue()

No, that won't work.

CheckboxGroup and RadioGroup are still missing getValue and setValue methods (see bugreport (http://extjs.com/forum/showthread.php?t=39161) with possible fixes).

samith143
4 May 2009, 3:21 AM
I found following way in below link
"http://extjs.com/forum/showthread.php?t=5911",



var allowCredit = Ext.DomQuery.selectValue('input[name=rb-allow-credit]:checked/@value');


Thanks.

4 May 2009, 3:29 AM
i find it a bit amusing that they have validation methods.

bt_bruno
4 May 2009, 11:58 AM
radio.getGroupValue() (http://www.extjs.com/deploy/dev/docs/?class=Ext.form.Radio&member=getGroupValue) solves it.