Is it possible in Yii2, when you click "submit" and have to wait until it is loaded, to have a window, or at least a message that "it's loading so be patient"? I have little experience with JavaScript, but I suppose that's the way to do that. I tried that:
<style>
#loading {
width: 30%;
height: 30%;
position: absolute;
left: 25%;
top: 25%;
background-color: green;
line-height: 5;
text-align: center;
display: none;
}
</style>
<script>
$('#formularz').on("submit", function() {
$("#loading").show();
});
</script>
<h1>Dodaj numery do przedzwonienia</h1>
<h3>Wybierz zamówienie, którego numery chcesz przedzwonić:</h3>
<div class="order-form" id="formularz">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'id')->dropDownList(ArrayHelper::map(Order::find()->all(), 'id', 'id')) ?>
<?= Html::submitButton("Przedzwoń", ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
<?php ActiveForm::end(); ?>
</div>
<div id="loading">
Ładowanie trwa...
</div>
But didn't work.