PDA

View Full Version : form.getValues() don't return checkbox fields



maneljn
25 Sep 2012, 8:40 AM
extjs 4.1.1

in my form there is a checkbox
with form.getValues() i can get all the fields without my checkbox

Is it normal ?

vietits
25 Sep 2012, 10:38 PM
checkboxfield is included in the result of form.getValues() only if it is checked or at least one of the checkbox in the same group is checked.

maneljn
26 Sep 2012, 6:22 AM
i found a solution, defining the uncheckedValue
Like this example the form.getValues() function puts the checkboxfield in the response always (checked and unchecked)



name: 'dir_activo',
fieldLabel: gt.dgettext('esicontactos','Activo'),
xtype: 'checkboxfield',
margins: '0 0 0 0',
inputValue: true,
// Si no definimos uncheckedValue solo se incluye en el getValues del form si esta chequedado.
uncheckedValue: false,
// Para que el cambio de campos con tabulador no se pare aqui
tabIndex: -1

radtad
10 Jul 2013, 2:41 PM
checkboxfield is included in the result of form.getValues() only if it is checked or at least one of the checkbox in the same group is checked.

That doesn't make any sense. So if I have a checkbox that is checked on initial value, I change it to unchecked it doesn't submit? The value has changed so there should it should be submitted just like any other field.