light / yii2-ajaxform
yii2 activeform ActiveForm ajax
Installs: 3 998
Dependents: 1
Suggesters: 0
Security: 0
Stars: 20
Watchers: 3
Forks: 5
Open Issues: 0
Requires
- php: >=5.4.0
- bower-asset/jquery-form: ~3.51
- yiisoft/yii2: ~2.0.6
Requires (Dev)
- phpunit/phpunit: ^4.8
This package is auto-updated.
Last update: 2024-10-08 19:40:34 UTC
README
Yii2 Ajax Form
Overview
Using jquery.form
to make ActiveForm
has ability to submit via ajax but not fullpage reload.
Install
Using composer:
$ composer require light/yii2-ajaxform=*
Usage
use light\widgets\ActiveForm; use yii\web\JsExpression; ActiveForm::begin([ 'ajaxSubmitOptions' => [ 'success' => new JsExpression('function(response) {console.log(response)}'), 'complete' => new JsExpression('function() {console.log("request completed.")}') ] ])
Options
- Default enabled
enableAjaxSubmit
is true ajaxSubmitOptions
you can find in jquery.form
Test
$ phpunit