how to set disabled in htmlOptions

there is my code:

<?php echo CHtml::submitButton('Publish',array('disabled'=>($model->status==1)?true:false)); ?>

whatever true or false,the submit button always disabled,why?

is it a bug or i am got a wrong way?

Please help.

Thanks a lot!

Should probably be …

<?php echo CHtml::submitButton(‘Publish’,array(‘disabled’=>($model->status==1)?‘disabled’:false)); ?>

To the browsers it’s the same if you put disabled=‘false’ or anything else… the button is always disabled if there is the keyword disabled so you should use


   echo CHtml::submitButton('Publish',$model->status==1 ? array('disabled'=>'disabled') : ''); 


Thank you very much!

Thank You

Great, thanks!