+ 4

How to switch between two modals in bootstrap4?

i am making a pop up login and sign up form so i want user to switch between login and sign.so there will be two modals.so how can i switch between em?

10th Oct 2018, 2:10 PM
umair
umair - avatar
5 ответов
+ 2
Voxel Hassan Saed Sergei No thank you all for giving me suggestions on how i can fix it ,i found a way to do that.i used the onclick function in the button and it worked for me.thanks again guys!
12th Oct 2018, 10:16 AM
umair
umair - avatar
+ 1
1. could try to switch only form inside popup 2. https://code.sololearn.com/WM269dV3I6ne/?ref=app try to use this approach, I’m just tried to switch them by default controls but it shows two modals at the same time
11th Oct 2018, 10:18 PM
Sergei No
Sergei No - avatar
0
I think you could have your button to switch between them call some JS onclick like: $('#signup').modal('hide'); And have one of these in your script: $('#signup').on('hidden.bs.modal', function (e) { $('#login').modal('show'); }); And vise versa for your switch back to signup.
10th Oct 2018, 3:27 PM
Voxel
Voxel - avatar
0
I think you should create 2 buttons, one for register and it should triggers the modal with your register form when clicked and the other button triggers the login modal
11th Oct 2018, 7:36 AM
Hassan Saed
Hassan Saed - avatar
- 1
artkrantipub.com/rollback
12th Oct 2018, 9:37 AM
Dass Guruprasad Soni
Dass Guruprasad Soni - avatar