Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
121
rated 0 times [  127] [ 6]  / answers: 1 / hits: 36046  / 9 Years ago, thu, june 18, 2015, 12:00:00

I have two modals, they pop up on button click. One works fine, however for the second one, the screen just goes black and nothing happens:



First, working modal:



<div id=deleteConfirmation class=hidden, modal fade>
<div class=modal-dialog>
<div class=modal-content>
<h5>Are you sure you want to delete this contact?</h5>
<button id=deleteOk>
Yes
</button>
<button id=deleteNo>
No
</button>
</div>
</div>
</div>


and pops up on this command:



$('#deleteConfirmation').modal('show');


Second one, is almost identical, but not working:



<div id=addContact class=hidden, modal fade>
<div class=modal-header>
<h5>Add New Contact</h5>
</div>
<div class=modal-dialog>
<div class=modal-content>
<label>First Name </label><input /> <br />
<label>Last Name </label><input /> <br />
<label>Address </label><input /> <br />
<label>Phone Number </label><input /> <br />

<button id=addConfirm>
Confirm
</button>
</div>
</div>
</div>


And the command:



$('#addContact').modal('show');


It's basically two identical modals, however for the second one, screen just goes black, and the first modal works correctly. I assume it's one of the classes that I'm using. What seems to be off here?


More From » jquery

 Answers
5

I created some modals at bootply and adapted your code, check out if this is of any help.



bootply example


[#66160] Tuesday, June 16, 2015, 9 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
samaraanandah

Total Points: 94
Total Questions: 86
Total Answers: 99

Location: Montenegro
Member since Thu, Jun 16, 2022
2 Years ago
;