H
H
hashasin2020-01-29 22:21:50
Bootstrap
hashasin, 2020-01-29 22:21:50

Bootstrap 4 modal window in modal window?

In general, the problem is this: I have a button on bootstrap 4 that, when clicked, a modal window appears, with a suggestion to log in or register. And when you click on the login button, another modal window appears with a login form, but the problem is that I don’t know how to close the previous modal window. It stays in the background.

Tell me, please, how to solve this problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
anyshape, 2020-01-30
@hashasin

Write a function that, on click, will close the first window and open the second one. All methods are in the bootstrap documentation

$('.login-btn').click(function(){
   $('#Modal1').modal('hide')
   $('#Modal2').modal('show')
})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question