PDA

View Full Version : extjs how to capture the field value



satya1974
25 Apr 2011, 7:51 AM
Hi,

I have two number fields entering value in 1st field, second field value should automatically get calculated through formula (first field value +10).

25 Apr 2011, 8:35 AM
you can use onBlur or onKeyUp.


That said, please post in the right forums.

satya1974
25 Apr 2011, 9:06 AM
thanks for your reply but the problem is when i am using Ext.getCMP("filename").value it saying null.

First Field : new myNumberField({
name: 'salary',
fieldLabel: 'Salary',
allowBlank:false,
decimalPrecision:2,
width:90
}),
Second Field : new myNumberField({
name: 'monthly salary',
fieldLabel: 'Monthly Salary',
allowBlank:false,
decimalPrecision:2,
width:90
}),

in the second field i want to display (first field value * 30)

Any help is highly appreciated.

satya1974
28 Apr 2011, 12:59 AM
can anyone please help me on this

varunach
28 Apr 2011, 2:24 AM
where is 'filename' in your code? you're trying to get a component that isn't defined.. also Ext.getCmp() fetches by id. Check if the component is created before using the the value of the component.

fay
28 Apr 2011, 4:14 AM
Also use the getValue() (http://dev.sencha.com/deploy/ext-3.3.1/docs/?class=Ext.form.NumberField&member=getValue) method not .value.