Quantcast
Channel: Live News for Yii Framework
Viewing all articles
Browse latest Browse all 2940

[extension] ayrozjlc/yii2-disable-submit-form

$
0
0

Yii2 Disable Buttons

  1. Installation
  2. Register Asset
  3. Usage

Yii2 asset to automatically disable submit buttons on Yii2 ActiveForm.

Installation

The preferred way to install this extension is through composer.

Either run

composer require --prefer-dist "ayrozjlc/yii2-disable-submit-form:*"

or add

"ayrozjlc/yii2-disable-submit-form": "*"

to the require section of your composer.json file.

Register Asset

Register the ayrozjlc\disablesubmit\DisableSubmitFormAsset, preferably on your AppAsset dependencies

class AppAsset extends yii\web\AssetBundle
{
    public $depends = [
        'ayrozjlc\disablesubmit\DisableSubmitFormAsset',
        // other dependencies
    ];
}

or add in view

// ...
use ayrozjlc\disablesubmit\DisableSubmitFormAsset;
// ...
DisableSubmitFormAsset::register($this);

Usage

add in view `php $customScript = " $('#id-form').disableForm({

disabled_text : 'message',
// block : true // to activate plugin blockui
// block_div : '#element' // by default it is applied to the parent element of the form

});"; $this->registerJs($customScript, \yii\web\View::POS_READY); `


Viewing all articles
Browse latest Browse all 2940

Trending Articles