PDA

View Full Version : Posting 'true-false' on 'check' and 'uncheck' of checkbox



Supriya Kale
25 Nov 2012, 10:39 PM
Hi,

I have a form containing many 'checkboxes'. The values for those checkboxes are being posted as 'on'/'off'. But instead I want to use 'true'/'false'. How can this be achieved?

sword-it
26 Nov 2012, 12:29 AM
Hi Supriya,

Which framework are you useing ? if it is 4.1.x then default value of check box is on/off.
you can also use inputValue config of check box.
For more info read API docs -http://docs.sencha.com/ext-js/4-1/#!/api/Ext.form.field.Checkbox-cfg-inputValue

Supriya Kale
2 Dec 2012, 1:41 AM
Hi Supriya,

Which framework are you useing ? if it is 4.1.x then default value of check box is on/off.
you can also use inputValue config of check box.
For more info read API docs -http://docs.sencha.com/ext-js/4-1/#!/api/Ext.form.field.Checkbox-cfg-inputValue


Thanks Sword, I went through the link and saw using 'inputValue' property by setting it to 'true' but its not working as even though I leave checkbox unchecked, the value is being passed as 'true' which is unexpected.
Is there some other way to work out?

Arg0n
3 Dec 2012, 12:56 AM
You could use the checked (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.form.field.Checkbox-cfg-checked) config instead... maybe :x

Supriya Kale
3 Dec 2012, 9:12 AM
You could use the checked (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.form.field.Checkbox-cfg-checked) config instead... maybe :x

Hi, Thanks for the reply.

How would it be if the checkbox is extended? when I extend it.. where to put the class physically?

Arg0n
3 Dec 2012, 1:16 PM
Huh??? xD

You extended the original ExtJs checkbox class and you don't know where to go with the file, do you?