2017 © Pedro Peláez
 

yii2-extension yii2-disable-submit-buttons

Yii2 asset to automatically disable submit buttons on Yii2 ActiveForm.

image

tecnocen/yii2-disable-submit-buttons

Yii2 asset to automatically disable submit buttons on Yii2 ActiveForm.

  • Friday, June 10, 2016
  • by neverabe
  • Repository
  • 4 Watchers
  • 2 Stars
  • 91 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 8 Forks
  • 0 Open issues
  • 3 Versions
  • 2 % Grown

The README.md

Tecnocen.com Yii2 Disable Buttons

Yii2 asset to automatically disable submit buttons on Yii2 ActiveForm., (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

composer require --prefer-dist "tecnocen/yii2-disable-submit-buttons:*"

or add, (*4)

"tecnocen/yii2-disable-submit-buttons": "*"

to the require section of your composer.json file., (*5)

Register Asset

Register the tecnocen\assets\ActiveFormDisableSubmitButonsAsset, preferably on your AppAsset dependencies, (*6)

class AppAsset extends yii\web\AssetBundle
{
    public $depends = [
        'tecnocen\\disablesubmitbutton\\assets\\ActiveFormDisableSubmitButtonsAsset',
        // other dependencies
    ];
}

Usage

Add css class disable-submit-buttons to your [ActiveForm] (http://www.yiiframework.com/doc-2.0/yii-widgets-activeform.html) widget., (*7)

Optionally if you want to change the text on a button, add the attribute data-disabled-text with the text to be changed., (*8)

$form = ActiveForm::begin([
    'options' => ['class' => 'disable-submit-buttons'],
    // other configurations
]);

    // inputs

    Html::submitButton('Submit', [
        // optional, will show the value of `data-disabled-text` attribute
        // while handling the validation and submit
        'data' => ['disabled-text' => 'Please Wait']
    ])

$form->end();

With this the :input[type="submit"] buttons will be disabled and if the validation fails the buttons will be enabled again, (*9)

License

The BSD License (BSD). Please see License File for more information., (*10)

The Versions

10/06 2016

dev-master

9999999-dev https://github.com/tecnocen-com/yii2-disable-submit-buttons

Yii2 asset to automatically disable submit buttons on Yii2 ActiveForm.

  Sources   Download

BSD-3-Clause

The Requires

 

yii2 jquery yii disable activeform

10/06 2016

0.2

0.2.0.0 https://github.com/tecnocen-com/yii2-disable-submit-buttons

Yii2 asset to automatically disable submit buttons on Yii2 ActiveForm.

  Sources   Download

BSD-3-Clause

The Requires

 

yii2 jquery yii disable activeform

10/06 2016

0.1

0.1.0.0 https://github.com/tecnocen/yii2-jquery-tagsinput

Yii2 asset to automatically disable submit buttons on Yii2 ActiveForm.

  Sources   Download

BSD-3-Clause

The Requires

 

yii2 jquery yii disable activeform