PHP code example of ayrozjlc / yii2-disable-submit-form

1. Go to this page and download the library: Download ayrozjlc/yii2-disable-submit-form 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/ */

    

ayrozjlc / yii2-disable-submit-form example snippets


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

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

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