Jump to content
  • 0

Как передать данные методом Post в другие поля


roswejj
 Share

Question

Доброго времени.
Для регистрационной формы добавил поле для подтверждения пароля ,также добавил виджет для генерации случайного пароля,.
Всё работает валидация js тоже,.на данный момент выглядит так- http://joxi.ru/1A5vdz9tno6Nzr 
то есть надо копировать руками и вставлять в другие два поля.
Мне нужно добавить автоматизацию что бы методом POST передавались данные по нажатии на submit из формы " сгенерировать" в формы " Пароль "и "Подтвердите пароль"

 

<div class="col-md-6">

                        <p>Сгенерировать</p>

                        <?= \dektrium\passfield\Passfield::widget([

                            'name'   => 'password', // the input name
                            'config' => []          // passfield configuration
                        ]) ?>

                        <?= $form->field($model, 'password')->passwordInput() ?>

                        <?php if ($module->enableGeneratingPassword === false): ?>// "Введите пароль "
                            <?= $form->field($model, 'password2')->passwordInput() ?>//"Подтвердите пароль"
                        <?php endif ?>

                    </div>

 

как я делал на чистом рнр у меня не получилось..
Как это в Yii2 это грамотно реализовать?

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy