holala
(Holala)
April 29, 2010, 12:57pm
1
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)); ?>
mdomba
(Maurizio Domba Cerin)
April 29, 2010, 1:37pm
3
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
<?php
echo CHtml::submitButton('Publish',$model->status==1 ? array('disabled'=>'disabled') : '');
?>