Can anyone give example of how to use CHtml::ajaxbutton
with Yii for posting the elements without form?
Quick Example
<?php
echo CHtml::ajaxSubmitButton('ButtonName',Yii::app()->createUrl('advert/LoadAdvertFromSay'),
array(
'type'=>'POST',
'data'=> 'js:{"data1": val1, "data2": val2 }',
'success'=>'js:function(string){ alert(string); }'
),array('class'=>'someCssClass',));
?>
ajaxSubmitButton()
You need a data
parameter inside the ajaxoptions
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With