Question: I have looked for a while, but I can't find a solution for this. I want the following:

* Open an URL inside a Bootstrap modal. I have this working off course. So the content is loaded dynamically.
* When an user pushes a button inside this modal, I want the current modal to hide, and immediately after that, I want a new modal to open with the new URL (which the user clicked on). This content of the 2nd modal is also loaded dynamically.
* If the user then closes that 2nd modal, the first modal must come back again.

I have been staring at this for days, hope someone can help me.

Thanks in advance.

Answer: 
As mentioned above In the html in the same button, you can ask to close the current modal with data-dismiss and open a new modal directly with data-target:

`<button class="btn btn-success" data-toggle="modal" data-target="#modalRegistration" data-dismiss="modal">Register</button>`

But this will cause scroll-bar to disappear and you will notice that if the second modal was taller than the first one

So the solution is to add the following style in the modal inline style :

`Style = "overflow-y : scroll ; "`
just close all open modals before opening a new one

```
$('.modal').modal('hide'); // close all open modals
$('#login').modal('show'); // open a modal named #login

```