yii2 - Login form requires second click to submit -
my backend login form submits single click of login button. creates <input type="hidden" name="login-button"> element shortly thereafter submits. on frontend same created on click never posts data until click button again.
here sample of view code:
<div id="login-form" class="col-sm-12"> <?php $form = activeform::begin(['id' => 'login-form']); ?> <?= $form->field($model, 'username') ?> <?= $form->field($model, 'password')->passwordinput() ?> <div class="col-sm-5 col-sm-offset-4 forgotpassword"> <?= $form->field($model, 'rememberme')->checkbox() ?> <div style="margin:auto;color:#fff;margin:1em 0;font-size:10px;"> if forgot password can <?= html::a('reset it', ['site/request-password-reset']) ?> </div> <div class="form-group"> <?= html::submitbutton('login', ['class' => 'btn btn-primary loginbutton', 'name' => 'login-button']) ?> </div> </div> <?php activeform::end(); ?> </div> the difference seeing between 2 there additional <div> tags have been added styling purposes. have removed , still seeing same issues.
any ideas appreciated.
it looks id on form div causing issue. removing has cleared up.
it causing conflict because had same id form.
Comments
Post a Comment