Download the PHP package faryshta/yii2-disable-submit-buttons without Composer
On this page you can find all versions of the php package faryshta/yii2-disable-submit-buttons. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download faryshta/yii2-disable-submit-buttons
More information about faryshta/yii2-disable-submit-buttons
Files in faryshta/yii2-disable-submit-buttons
Package yii2-disable-submit-buttons
Short Description Yii2 asset to automatically disable submit buttons on Yii2 ActiveForm.
License BSD-3-Clause
Homepage https://github.com/Faryshta/yii2-jquery-tagsinput
Informations about the package yii2-disable-submit-buttons
Faryshta Yii2 Disable Buttons
Yii2 asset to automatically disable submit buttons on Yii2 ActiveForm.
Installation
The preferred way to install this extension is through composer.
Either run
or add
to the require
section of your composer.json
file.
Register Asset
Register the faryshta\disableSubmitButtons\Asset
, preferably on your
AppAsset
dependencies
Usage
Add css class disable-submit-buttons
to your [ActiveForm]
(http://www.yiiframework.com/doc-2.0/yii-widgets-activeform.html) widget.
Optionally if you want to change the text on a button, add the attribute
data-disabled-text
with the text to be changed.
With this the :input[type="submit"]
buttons will be disabled and if the
validation fails the buttons will be enabled again.
Javascript
This asset adds 2 methods on jQuery disableSubmitButtons()
and
enableSubmitButtons()
which can be called from a <form>
tag generated by
ActiveForm widget.
Ajax Example
The following example submits the form using ajax and enables the submit buttons so the ur ser can send another form after completing the ajax request.
Then on ajax-form.js
Live Demo
You can run a live demo of this library with the following composer commands
License
The BSD License (BSD). Please see License File for more information.