Answer the question
In order to leave comments, you need to log in
Why does the address get corrupted when moving from one modal window to another?
From the main menu:
[code] $menuItems = [
['label' => 'Home', 'url' => ['/site/index']],
['label' => 'References', 'url' = > ['/manual1/index']],
['label' => 'Login/Register', 'url' => '#', 'options' => ['value' => Url::to([' site/login']),
'class'=>'update-modal-click', ]],
]; [/code]
when [b] 'Login/Register'[/b] is called, [b]veiw login[/b] is displayed in the modal window:
[code] <?php $form = ActiveForm::begin([
'id' => 'login-form',
]); ?>
<
<?= $form->field($model, 'password')->passwordInput()->label('Password') ?>
<?= Html::submitButton('Enter', ['class' => ' btn btn-primary','name' => 'login-button', 'value' => 'login',]) ?>
<?= Html::a('Login', ['value' => Url: :to('/site/register'), 'class'=>'update-modal-click',] ) ?>
<?php ActiveForm::end(); ?>
[/code]
Calling a modal window:
[code]<?php
Modal::begin([
'id' => 'modal',
]);
echo "";
modal::end();
?>[/code]
Tell me, please, how to call view register from [b]view login[/b] in modal window. At the same time, close the modal window with [b]veiw login[/b]
How to correctly form the address in:
[code] <?= Html::a('Registration', ['value' => Url::to('/site/register'), 'class'=>'update-modal- click',] ) ?>
[/code]
When you call "Register", the following address is generated:
[quote]/index.php?r=site%2Flogin&value=%2Fsite%2Fregister&class=update-modal-click[/quote]
Maybe something needs to be changed in the js script. I just can't figure it out. Help me please.
js file:
[code] $('#btnModal').on('click', function (e) {
$('#modal').modal('show')
.find('#modalContent')
.load( $(this).attr('value'));
} );
$('.
$('#modal').modal('show')
.find('#modalContent')
.load($(this).attr('value'));
});
[/code]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question