Answer the question
In order to leave comments, you need to log in
Bad Request (#400) Unable to verify your data submission. in yii2 how to solve?
Gentlemen, I have an error when submitting a form in yii2:
Bad Request (#400) Unable to verify your data submission.
<?
$form2 = ActiveForm::begin(['id' => 'user-univer']);
echo $form2->field($model2, 'university')->label('Input university name:');
echo $form2->field($model2, 'degree')->label('Input your education specialization:');
//echo $form2->field($model2, 'date')->label('Input your education date:');
echo '<label class="control-label">Education time:</label><br/>';
echo '<span>Start date of your education:</span>';
echo DatePicker::widget([
'model' => $model2,
'attribute' => 'date_from',
'value' => $value,
'dateFormat' => 'dd.MM.yyyy',
]);
echo '<span>End date of your education:</span>';
echo DatePicker::widget([
'model' => $model2,
'attribute' => 'date_to',
'value' => $value,
'dateFormat' => 'dd.MM.yyyy',
]);
echo '<br/><br/>';
echo $form2->field($model2, 'info')->textarea()->label('Any other information about your university degree:');
echo Html::submitButton('Add university', ['class' => 'btn btn-primary btn-univer']);
ActiveForm::end(['id' => 'user-univer']);
} ?>
Answer the question
In order to leave comments, you need to log in
The problem I had was that in the view file it turned out that one form was inside another, which apparently caused problems with reading the token.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question