开发者

CakePHP FormHelper - Can't disable multiple checkboxes

I've got the following in my view:

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

But, the checkboxes aren开发者_运维技巧't disabled...


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.


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' ) );
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜