Answer the question
In order to leave comments, you need to log in
ActiveForm begin - how to assemble the desired form?
Active Form
<?php $form = ActiveForm::begin([
// 'enableClientValidation' => true,
// 'enableAjaxValidation' => true,
'id' => 'form-signup',
// 'fieldConfig' => [
// 'template' => '<div class="r-f-pp">{label}{input}</div>',
// ],
]); ?>
<div class=r-f-b>
<div class=r-f-pp>
<?= Html::activeLabel($model, 'name') ?>
<?= $form->field($model, 'username') ?>
</div>
</div>
<div class=r-f-b>
<div class=r-f-pp-l>
<?= Html::activeLabel($model, 'email') ?>
<?= $form->field($model, 'email') ?>
</div>
</div>
<div class=r-f-b>
<div class=r-f-pp>
<?= Html::activeLabel($model, 'password') ?>
<?= $form->field($model, 'password')->passwordInput() ?>
</div>
</div>
<div class=r-f-pp-h>
<?= Html::submitButton('Готово!', ['class' => 'card-button blue', 'name' => 'signup-button']) ?>
</div>
<?php ActiveForm::end(); ?>
<!-- <form class=reg-from-popup action="javascript:void(null);">
<div class=r-f-b>
<div class=r-f-pp>
<label for=name><span>Ваше имя</span><input id=name type=text name=name></label>
</div>
<div class=r-f-pp>
<label for=last-name> <span>Фамилия</span> <input id=last-name type=text name=lastname></label>
</div>
</div>
<div class=r-f-b>
<div class=r-f-pp-l>
<label for=mail> <span>Электронная почта</span> <input id=mail type=email name=login></label>
<p class=p-att>Нужна чтобы вы смогли войти на сайт. Отправлять ничего не будем.</p>
</div>
</div>
<div class=r-f-b>
<div class=r-f-pp>
<label for=pwd> <span>Пароль</span> <input id=pwd class=error type=password name=password></label>
</div>
<div class=r-f-pp-h>
<button class="card-button blue" onclick="singup();">Готово!</button> </div>
</div>
</form>-->
Answer the question
In order to leave comments, you need to log in
Hello,
I'm trying to make something like this.
<div class=reg-block id=reg-block>
<form class=reg-form-popup>
<div class=r-f-b>
<div class=r-f-pp>
<label for=name> <span>Ваше имя</span><input id=sinup-name type=text name=name></label>
</div>
<div class=r-f-pp>
<label for=last-name> <span>Фамилия</span> <input id=sinup-last-name type=text name=lastname></label>
</div>
</div>
<div class=r-f-b>
<div class=r-f-pp-l>
<label for=mail> <span>Электронная почта</span> <input id=mail type=email name=login></label>
<p class=p-att>Нужна чтобы вы смогли войти на сайт. Отправлять ничего не будем.</p>
</div>
</div>
<div class=r-f-b>
<div class=r-f-pp>
<label for=pwd> <span>Пароль</span> <input id=pwd type=password name=password></label>
</div>
<div class=r-f-pp-h> <button class="card-button blue" >Готово!</button> </div>
</div>
</form>
</div>
<div class=reg-block id=reg-block>
<?php $form = ActiveForm::begin([
'action' => '/site/singup',
'method' => 'POST',
'id' => 'form-signup',
'options' => ['class' => 'reg-from-popup'],
]); ?>
<div class=r-f-b>
<?= $form->field($model, 'username', [
'inputTemplate' => '<div class=r-f-pp>
<label for=name> <span>Ваше имя</span>{input}</label></div>',
])->label(false)->error(false); ?>
<?= $form->field($model, 'lastname', [
'inputTemplate' => '<div class=r-f-pp>
<label for=last-name> <span>Фамилия</span> {input}</label></div>',
])->label(false)->error(false); ?>
</div>
<?= $form->field($model, 'email', [
'inputTemplate' => '<div class=r-f-b>
<div class=r-f-pp-l>
<label for=mail> <span>Электронная почта</span> {input}</label>
<p class=p-att>Нужна чтобы вы смогли войти на сайт. Отправлять ничего не будем.</p>
</div>
</div> ',
])->label(false)->error(false); ?>
<div class=r-f-b>
<?= $form->field($model, 'password', [
'inputTemplate' => '
<div class=r-f-pp>
<label for=pwd> <span>Пароль</span> {input}</label>
</div>',
])->passwordInput()->label(false)->error(false); ?>
<div class=r-f-pp-h>
<?= Html::submitButton('Готово!', ['class' => 'card-button blue', 'name' => 'signup-button']) ?>
</div>
</div>
<?php ActiveForm::end(); ?>
</div>
<div class=r-f-b>
<div class="form-group field-signupform-username required">
<div class=r-f-pp>
<label for=name> <span>Ваше имя</span><input type="text" id="signupform-username" class="form-control" name="SignupForm[username]"></label></div>
</div>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question