PDA

View Full Version : hot to get the inputValue



crocop21
25 Jul 2012, 12:01 PM
Hi all, i am trying to get the input value from a radio who is in a radio group for compare:
my radio is:

xtype: 'radiofield',
id: 'rd_mail',
name: 'rd',
boxLabel: 'Send',
inputValue: 'yes',
flex: 1
I try to do this

var rd1 = Ext.getCmp('rd_mail').getValue();
if(rd1== yes)
{
NewPanel.show();
}

but is showing me "false"

scottmartin
25 Jul 2012, 2:42 PM
You are comparing using wrong value...



Ext.create('Ext.form.Panel', {
title : 'Order Form',
width : 300,
bodyPadding: 10,
renderTo : Ext.getBody(),
items: [
{
xtype : 'fieldcontainer',
fieldLabel : 'Size',
defaultType: 'radiofield',
inputValue: 'on',
defaults: {
flex: 1
},
layout: 'hbox',
items: [
{
boxLabel : 'M',
name : 'size',
inputValue: 'm',
id : 'radio1'
}, {
boxLabel : 'L',
name : 'size',
inputValue: 'yes',
id : 'radio2'
}, {
boxLabel : 'XL',
name : 'size',
inputValue: 'xl',
id : 'radio3'
}
]
}
]
});

r2 = Ext.getCmp('radio2');
r2.setValue('yes');
console.log(r2.getValue());
‚Äč

Scott.