views:

117

answers:

2

I've got the following in my view:

echo $form->input('Category', array('multiple' => 'checkbox', 'disabled' => true));

But, the checkboxes aren't disabled...

A: 

Try the checkbox() method in the form helper. API link: http://api.cakephp.org/class/form-helper#method-FormHelpercheckbox

Just change your syntax (I think it's just a wrapper around the FormHelper::input, but this should work):

echo $form->checkbox( 'Category', array( 'disabled' => true ) );

If that doesn't work, post the HTML that is output from your call.

Travis Leleu
Already tried that, it doesn't work. Posted a ticket on cakephp.lighthouseapp.com. See here: http://cakephp.lighthouseapp.com/projects/42648/tickets/808-form-input-cant-disable-multiple-checkboxes
Temega
A: 

I think you should pass true as string like:

echo $form->checkbox( 'Category', array( 'disabled' => 'true' ) );

If this doesn't work use

echo $form->checkbox( 'Category', array( 'disabled' => 'disabled' ) );
Nik