[symfony-users] Disable checkbox without loosing value?

2010-04-07 Thread axel at
hello, to disable a checkbox in a form for certain users I use: if (!user-mayXY() { $this-widgetSchema['active'] = new sfWidgetFormInputCheckbox(array(), array('disabled' = 'disabled')); } to disable editing of the checkbox but still displaying the current setting. the problem is that symfony

Re: [symfony-users] Disable checkbox without loosing value?

2010-04-07 Thread Gábor Fási
It gets overwritten because browsers do not send disabled inputs' values, just like when a checkbox is not checked. Therefore symfony interprets it as a false. Overwrite the forms doBind() method, to set the fields current value in the input (tainted) array. On Wed, Apr 7, 2010 at 16:13, axel at