Reputation: 300
Is there any way to stop user to send multiple submit to server by fast clicking on submit button when using pjax in yii ?
<?php
Pjax::begin()
$form = ActiveForm::begin(['options' => ['data' => ['pjax' => true]],]);
echo $form->field($model, 'username');
echo $form->field($model, 'password')->passwordInput();
echo Html::submitButton(Yii::t('app', 'Submit'), ['class' => 'btn btn-primary']);
ActiveForm::end();
Pjax::end();
?>
Upvotes: 0
Views: 894
Reputation: 391
You need to disable the submit button after successfully submit( Without any remaining form validation error) so you can avoid multi submit at a time.
Upvotes: 2