Hello, I already had all the Internet, but I could not find a solution. Just starting acquaintance and yii and I can not figure out how to implement the form via ajax using the means of yii. I know how to do without the help of yii

$.getJSON("fil.php", {},function(data){}); 

In fil.php we process and send the response to the function. And how to do everything the same, but using yii? There are many forms in the network, for example

 <?php $form = $this->beginWidget('CActiveForm', array( 'id' => 'ID ВАШЕЙ ФОРМЫ', 'enableClientValidation' => true, )); ?> <!-- здесь ваш html-код формы --> <?php echo CHtml::ajaxSubmitButton('Send my coupon', '', array( 'type' => 'POST', 'success' => 'js: function(data) { }', ), array( 'type' => 'submit', ); ?> <?php $this->endWidget(); ?> 

Where do we process the data here?)

    1 answer 1

    The data is processed in the controller, the form only sends them. You can see an example of the implementation of form submission via ajax here.