$('#modal').modal('show')
.change($('#modalContent').html('<div style="display:flex;justify-content: center;margin: 60px 0;"><img src="/images/loader/35.gif"></div>'))
.find('#modalContent')
.load($(this).attr('href'))
$('#form-message-services').submit(function (e) {
e.preventDefault();
var form = $(this);
var data = new FormData(this);
var spiner = $('.fa-spinner');
var button = $('.send-button');
if ($('.textarea').val().length > 0) {
preloader(spiner, button);
$.ajax({
url: form.attr('action'),
method: form.attr('method'),
data: data,
async: false,
cache: false,
contentType: false,
processData: false,
success: function(data) {
var div = $('.cnt');
div.html(data);
div.scrollTop(div.prop('scrollHeight'));
$('.file-upload').html('');
form[0].reset();
},
});
setTimeout(function () {
preloader(spiner, button);
}, 500);
}
});
<?php
/**
* @var $this \yii\web\View
* @var $model \common\models\RegistryArkBanks
*/
use yii\helpers\Html;
use yii\helpers\Url;
...
$this->registerJsFile('/lk/static/js/vendor.js');
$script = <<<JS
$('input[type="datepicker"]').datepicker();
$('input[type="money"]').mask('000 000 000 000', {reverse: true});
...
JS;
$this->registerJs($script);
?>
<?= Html::beginForm(Url::to(['credit/update', 'id' => $model->id]), 'post', [
'id' => 'block-credit-create_form'
]) ?>
<div class="content form">
...
<div class="field">
<label>Сумма долга<span class="required-symbol">*</span></label>
<?= Html::input('money', 'RegistryArkBanks[contract_sum]', Html::encode($model->contract_sum), [
'class' => 'input _fill'
]) ?>
<div class="__error"><?= $model->getFirstError('contract_sum') ?></div>
</div>
<div class="field">
<label>Сумма, взятая в кредитной организации</label>
<?= Html::input('money', 'RegistryArkBanks[contract_initial_sum]', Html::encode($model->contract_initial_sum), [
'class' => 'input _fill'
]) ?>
<div class="__error"><?= $model->getFirstError('contract_initial_sum') ?></div>
</div>
<div class="field">
<label>Номер банковской карты</label>
<?= Html::input('text', 'RegistryArkBanks[contract_card_number]', Html::encode($model->contract_card_number), [
'class' => 'input _fill'
]) ?>
<div class="__error"><?= $model->getFirstError('contract_card_number') ?></div>
</div>
<div class="field">
<label>Дата заключения<span class="required-symbol">*</span></label>
<?= Html::input('datepicker', 'RegistryArkBanks[contract_date]', !empty($model->contract_date) ? date('Y-m-d', $model->contract_date) : null, [
'class' => 'input _fill'
]) ?>
<div class="__error"><?= $model->getFirstError('contract_date') ?></div>
</div>
<div class="field">
<label>Дата начала просрочки</label>
<?= Html::input('datepicker', 'RegistryArkBanks[date_start_overdue]', !empty($model->date_start_overdue) ? date('Y-m-d', $model->date_start_overdue) : null, [
'class' => 'input _fill'
]) ?>
<div class="__error"><?= $model->getFirstError('date_start_overdue') ?></div>
</div>
</div>
<div class="footer">
<button type="submit" href="#" class="btn _fill">Редактировать</button>
</div>
<?php Html::endForm() ?>