yii2 ajaxform
1.0.2
Using jquery.form
to make ActiveForm
has ability to submit via ajax but not fullpage reload.
Using composer:
$ composer require light/yii2-ajaxform=*
use lightwidgetsActiveForm;
use yiiwebJsExpression;
ActiveForm::begin([
'ajaxSubmitOptions' => [
'success' => new JsExpression('function(response) {console.log(response)}'),
'complete' => new JsExpression('function() {console.log("request completed.")}')
]
])
enableAjaxSubmit
is trueajaxSubmitOptions
you can find in jquery.form$ phpunit