$checkOrderForm = $this->beginWidget('CActiveForm', array(
'id' => 'check-order-form',
'stateful' => true,
'enableClientValidation' => true,
'clientOptions' => array(
'hideErrorMessage' => TRUE,
'validateOnSubmit' => TRUE,
'validateOnChange' => FALSE,
'validateOnType' => TRUE,
'errorCssClass' => 'has-error',
'afterValidate' => 'js:ajaxCheckOrder',
)
));
function ajaxCheckOrder(form, data, hasError) {
if (!hasError) {
$.ajax({
type: "POST",
//url: "",
data: $("#check-order-form").serialize(),
success: function(data) {
$("#checkOrderResult").slideUp(400, function() {
$(this).html(data);
}).slideDown();
}
});
return false;
}
}
<?= CHtml::submitButton('Проверить') ?>