PHP code example of tecnocen / yii2-disable-submit-buttons

1. Go to this page and download the library: Download tecnocen/yii2-disable-submit-buttons library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

tecnocen / yii2-disable-submit-buttons example snippets


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

$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();