Skip to content
submit ActiveForm via ajax
Branch: master
Clone or download
lichunqiang fix: adapt for missing return
yiisoft/yii2 2.0.16 changed `yii/widget/ActiveForm::run` behavior

@see https://github.com/yiisoft/yii2/blob/2.0.16/framework/CHANGELOG.md
Latest commit 659dea0 May 8, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src fix: adapt for missing return May 8, 2019
tests
.editorconfig Release 1.0.2 Oct 20, 2016
.gitattributes
.gitignore Release 1.0.2 Oct 20, 2016
.php_cs
.travis.yml fix: adapt for missing return May 8, 2019
LICENSE Release 1.0.2 Oct 20, 2016
README.md
composer.json fix: adapt for missing return May 8, 2019
composer.lock fix: adapt for missing return May 8, 2019
phpunit.xml.dist Release 1.0.2 Oct 20, 2016

README.md

Yii2 Ajax Form


Build Status version Download Issues

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

LICENSE

MIT

Bitdeli Badge

You can’t perform that action at this time.