PDA

View Full Version : Getting the value of a radiogroup



ruchika
11 Dec 2009, 1:03 AM
I am having a radiogroup with 4 radio buttons, on form submit i need the value of the checked radio button. How do i get it.please suggest.

Thanks

ruchika
11 Dec 2009, 2:20 AM
My code for the radiogroup is:

{
xtype: 'radiogroup',
hideLabel:true,
name:'contract_Radiogrp',
columns: 2,
anchor: '95%',
items: [
{boxLabel: 'Red', name: 'contr_rdgrp', inputValue: '1a'},
{boxLabel: 'Yellow', name: 'contr_rdgrp', inputValue: '2a', checked: true},
{boxLabel: 'Blue', name: 'contr_rdgrp', inputValue: '3a'},
{boxLabel: 'Pink', name: 'contr_rdgrp', inputValue: '4a'}
]
}

Please suggest.

linuxguy2001
1 Jun 2010, 7:22 AM
I'm not sure if you still need help with this, but this works for me:


{xtype:'radiogroup',
fieldLabel: 'Work Order Status',
columns:1,
layout:'column',
columnWidth: .99,
id:'status_id',
name:'status_txt',
defaults:{name:'status_txt'},
items: [
{boxLabel: 'Open', inputValue: 'open'},
{boxLabel: 'Awaiting Repair', inputValue: 'Awaiting Repair'},
{boxLabel: 'Awaiting Parts', inputValue: 'Awaiting Parts'},
{boxLabel: 'At Factory', inputValue: 'At Factory'},
{boxLabel: 'Awaiting Customer Input', inputValue: 'Awaiting Customer Input'},
{boxLabel: 'Completed', inputValue: 'Completed'}
]
}


Just make sure you reference name: status_txt in your submit form; i.e. if using php, just do '$_POST[status_txt]'

Hope this helps. (www.foscode.com)