PHP code example of faryshta / yii2-disable-submit-buttons
1. Go to this page and download the library: Download faryshta/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/ */
faryshta / yii2-disable-submit-buttons example snippets
use faryshta\disableSubmitButtons\Asset as DisableSubmitButtonAsset;
class AppAsset extends yii\web\AssetBundle
{
public $depends = [
DisableSubmitButtonsAsset::class,
// 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();