Reputation: 232
I have the following:
<button type="button submit id="delete-selected" class="btn btn-danger></button>
then some more code...
<script>
$(function(){
$('#delete-selected').click(function(e){
var currentButton = this;
e.preventDefault();
bootbox.confirm("Are you sure", function(confirmed){
if(confirmed){
currentButton.submit();
}
});
});
</script>
Now everything works fine...except the button won't actually submit anything when I click OK...
Upvotes: 1
Views: 252
Reputation: 232
so I realized what I was doing makes no sense... last line should be changed to :
$('form').submit();
as obviously you can't submit a button..works now :)
Upvotes: 1