jquery - Bootstrap Modal not showing on second element -


hey new bootstrap. want build safe delete button modals. when click ask: want delete? , can choose yes or no. there more 1 element in field. @ first 1 works fine. @ second element same data shown in first one. if reload page , click second element backdrop shown , no dialogue.

the code:

<div class="modal fade" id="deletesecuredialoge" data-keyboard="true" data-backdrop="static" role="dialog">     <div class="modal-dialog">     <div class="modal-content">         <div class="modal-header">             <button type="button" id="close" class="close" data-dismiss="modal">&times;</button>             <h4 class="modal-title">warning</h4>         </div>         <div class="modal-body">             <p>are sure delete {{item._id}}?</p>         </div>         <div class="modal-footer">             <button type="button" id="delete" class="btn btn-danger btn-sm" ng-click="deleteitem(item)" data-dismiss="modal">delete</button>             <button type="button" id="cancel" class="btn btn-default" data-dismiss="modal">cancel</button>         </div>     </div> </div> 

in other file bind on

<div class="form-group">             <span ng-include='"templates/buttons.jsp"'></span> 

any idear cause problem?

the following code give confirmation window while click on delete button. please fill contents.

html part

  <form >     <button class='btn btn-danger btn-xs' type="submit" name="remove_levels" value="delete"><span class="fa fa-times"></span> delete</button>     </form>     <div id="confirm" class="modal hide fade" style="background: blanchedalmond;">       <div class="modal-body">        <h1>           sure delete?       </h1></div>       <div class="modal-footer">         <button type="button" class="btn btn-primary" id="delete">yes</button>         <button type="button" class="btn">no</button>       </div>     </div> 

js part

$('button[name="remove_levels"]').on('click', function(e){     var $form=$(this).closest('form');     $('#confirm').modal({ backdrop: 'static', keyboard: false }) }); 

Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -