1
I have an application with bootstrap modal, but when sending the data with the button it duplicates the event, follow the js with duplication.
$(document).on('click', '.form-delete', function(e){
e.preventDefault();
var $form=$(this);
$('#title_delete').val($(this).data('title'));
$('#confirm').modal({ backdrop: 'static', keyboard: false })
.on('click', '#delete-btn', function(){
alert($form);
});
});
The operation is as follows, if close the modal and open again, when clicking the delete button and send the data it sends the data of the previous and the current modal.
Follow the test link https://jsfiddle.net/308s2ftk/3/
Can you describe how the upload is done better? You may need html to view the Forms.
– Joao Paulo
I’ll make it work and post
– Rafael Meirim
I put the link of the test, note that if you close the modal and open again, click delete it will duplicate the event
– Rafael Meirim
Try to bind like this:
$(document).unbind('click').on('click' ...
– Sorack