0

在我看来,我有以下几点:

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

但是,复选框没有被禁用......

4

2 回答 2

0

尝试表单助手中的 checkbox() 方法。API 链接:http ://api.cakephp.org/class/form-helper#method-FormHelpercheckbox

只需更改您的语法(我认为它只是 FormHelper::input 的包装器,但这应该可以工作):

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

如果这不起作用,请发布您的调用输出的 HTML。

于 2010-06-09T22:51:03.847 回答
0

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' ) );
于 2010-06-10T09:59:15.680 回答