PDA

View Full Version : [RESOLVED] Can't sumbit Ext.form.Checkbox when not checked



sora
20 Apr 2010, 11:47 PM
Hello,

When submit with checkbox not checked, none value is sent.
I want send "false" or "0" or "on" when not check and "true".... when is checked but value is sent only when checkbox is checked.



this.fieldPublier = new Ext.form.Checkbox({
labelAlign: 'left',
fieldLabel: 'Publier',
autoWidth: true,
name: 'publier',

originalValue: 'false',
startValue: 'true',
listeners: {
render: function (cpn) {
if (config.data !== undefined)
cpn.setValue(config.data.publier);
}
}
});
First snapshot is checkbox not checked (can't see variable "publier" present)
20040


Second snapshot is checkbox checked (can see variable "publier" present)
20041

Sorry for my bad english.
Thanks for you interesting

--
Cordialement SORA

Animal
21 Apr 2010, 12:22 AM
That's how HTML checkboxes work.

They either submit their configured value, or not, depending on the checked state of their UI. They do not submit "true" or "false" depending on checked state.

This trips up HTML beginners.

I agree that Ext should offer configurations for Ext.form.Checkbox to allow it to represent a true/false input which depends upon checked state. This is a common requirement.

sora
21 Apr 2010, 1:01 AM
That true,


For a long time I not send checkbox without javascript, I forget the standard html.

Maybe build an extension if i have a lot of time.

Thanks for you fast response.

--
Cordialement SORA