I am having some difficulty accessing the value of the selected radio button in a radiogroup. I've attempted a number of different approaches based upon discussion in other posts on the forum and around the web. Unfortunately haven't been lucky (or skilled) enough to get it working. Based on the following FormPanel config I was hoping someone could show me how to get the value of the selected radio in the group 'mainPhone'.
Thanks!
Wanted to update to indicate that I was able to get a response from stackoverflow while the EXT-JS forums didn't provide me with any help. Way to go stackoverflow!
Matt
function createForm(elem) {
var myForm2 = new Ext.form.FormPanel({
renderTo:elem,
width:425,
frame:true,
style:"margin: 10px auto 10px auto;",
items: [{xtype:'fieldset',
title: 'Contact Info',
autoHeight:true,
items :[new Ext.form.RadioGroup({
fieldLabel: 'Main Phone',
vertical: false,
id:"mainPhone",
items: [
{boxLabel: 'Home', name: 'id-1', inputValue: 'H', checked:true},
{boxLabel: 'Work', name: 'id-1', inputValue: 'W'},
{boxLabel: 'Other', name: 'id-1', inputValue: 'O'}
]
}),
new Ext.form.TextField({
id:"frm_CreateCustomerHomePhone",
fieldLabel:"Home Phone",
width:275,
allowBlank:true
}),
new Ext.form.TextField({
id:"frm_CreateCustomerWorkPhone",
fieldLabel:"Work Phone",
width:275,
allowBlank:true
})
new Ext.form.TextField({
id:"frm_CreateCustomerOtherPhone",
fieldLabel:"Other Phone",
width:275,
allowBlank:true
})
]}]});
}
This is something of a wild guess, but how about this:
myForm2.getForm().getValues()['id-1'];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With