prad
prad

Reputation: 9

Open modal popup in another modal popup

I want to open modal popup within another popup.

Is it possible in Yii2.0?

I have one modal popup window, there is one link inside, after clicking on that link i want to open one small popup without closing parent window.

<?= Html::a('Click here to skip it', ['customer/loststicker']) ?>

Upvotes: 0

Views: 8908

Answers (1)

arogachev
arogachev

Reputation: 33548

The more correct formulation should be "Is it possible with Bootstrap 3?" since Yii2 is integrated with Bootstrap 3 and provide widgets for most of js components including Modal.

At first check official Bootstrap 3 documentation about modal:

Overlapping modals not supported

Be sure not to open a modal while another is still visible. Showing more than one modal at a time requires custom code.

So you need custom solution to implement this.

I think there are two main possible variations:

  • Close first modal, open second; when closing second, open first again. If the size of the second window is the same as first or more than first, visually you can't tell that first window is closed (don't sure about the animations though).
  • First modal stays opened when second appears.

If you do some research here you find few similar questions:

So for your case i think using Stackable will be more suitable.

Upvotes: 2

Related Questions