teguh11
(Teguhkrstianto)
1
i have problem with CHtml:button…
i write like this.
echo CHtml::Button('Accept', array('submit' =>Yii::app()->createUrl("/adsBanner/accept", array("id" => $model->id_ads_banner)),'onClick'=>'confirm("Are you sure?")','name'=>'accept'));
when i click yes, action execute, but when i click no. action execute too.
how to resolve this??
rookie84
(Lifeline Is)
2
Put it like this: (you missed the return keyword)
‘onClick’=>‘return confirm(“Are you sure?”);’
teguh11
(Teguhkrstianto)
3
not work…
button “No” can’t working properly
abennouna
(Abennouna)
5
What you wrote is not compliant with CHtml:button() reference.
Instead:
echo CHtml::button('Accept', array('submit' =>Yii::app()->createUrl("/adsBanner/accept", array("id" => $model->id_ads_banner)), 'confirm'=>'Are you sure?', 'name'=>'accept'));