Answer the question
In order to leave comments, you need to log in
How to fix Yii2, jQuery(...).yiiActiveForm is not a function?
Tell me, when placing the ActiveForm widget on the page, the error jQuery (...) is displayed. yiiActiveForm is not a function. In this case, validation does not work. How to fix it.
Answer the question
In order to leave comments, you need to log in
Apparently, the form scripts were not connected. Show how you get it.
...... <?=
ModalCreateUserForm::widget([
'model' => $model,
'userRole' => "Администратор"
]);
?>.....
....
$form = ActiveForm::begin(['options' => ['class' => 'panel-body'],
'id' => 'createUserForm',
'enableAjaxValidation' => true,
'enableClientValidation' => true,
'validationUrl' => Url::to(['create-user-admin'])
]);
// $form = ActiveForm::begin([
// 'action' => Url::to(['users']),
// 'options' => ['class' => 'panel-body' ] ,
// 'id' => 'createUserForm',
// 'method' => 'POST',
// 'ajaxDataType' => 'x-www-form-urlencoded',
// 'enableAjaxValidation' => true]);
echo Html::beginTag('div', $options = ['class' => 'form-group']);
echo $form->field($this->model, 'login')->input('login')
->label('Логин');
echo Html::endTag('div');
echo Html::beginTag('div', $options = ['class' => 'form-group']);
echo $form->field($this->model, 'fullName')->input('login')
->label('Ф.И.О.');
echo Html::endTag('div');
echo Html::beginTag('div', $options = ['class' => 'form-group']);
echo $form->field($this->model, 'email')->input('email')->label('E-mail');
echo Html::endTag('div');
echo Html::beginTag('div', $options = ['class' => 'form-group']);
echo $form->field($this->model, 'password')->passwordInput()->label('Пароль');
echo Html::endTag('div');
echo Html::beginTag('div', $options = ['class' => 'form-group']);
echo $form->field($this->model, 'confirmPassword')->passwordInput()->label('Подтваердить пароль');
echo Html::endTag('div');
echo Html::beginTag('div', $options = ['class' => 'modal-footer']);
echo Html::a($text = 'Close', $url = "#", $options = [
'class' => 'btn btn-white',
'data-dismiss' => 'modal'
]);
echo Html::submitButton('Создать', ['class' => 'btn btn-primary']);
ActiveForm::end();....
The piece of the widget itself
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question