Closed pugovok closed 8 years ago
How to disable beforeunload action when user is submitting a form?
Example:
<?php $form = ActiveForm::begin(); ?> <?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?> <?= $form->field($model, 'text')->widget(\dosamigos\ckeditor\CKEditor::className(),[ 'options' => ['rows' => 10], 'preset' => 'full' ]); ?>
It may be so,
$js = <<<JS $('form').submit(function() { $(window).unbind('beforeunload'); }); JS; $this->registerJs($js);
but it's bad
http://www.ramirezcobos.com/2014/09/12/how-to-implement-form-events-on-yii2/
How to disable beforeunload action when user is submitting a form?
Example: