light/yii2-ajaxform

yii2 activeform ActiveForm ajax

1.0.3 2019-05-08 07:56 UTC

This package is auto-updated.

Last update: 2024-12-08 20:03:36 UTC


README

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