I have this button in a bootstrap modal dialog:
<button id=btnSelectAll style=float:left>Select All</button>
The click event looks like this, all it is supposed to do is mark a bunch of checkboxes as checked.
$(document).on('click', '#btnSelectAll', function ()
{
var $modal = $('#MyPanel');
$modal.find('#aCheckBox').prop('checked', true);
});
Here is the markup for the modal itself (with specifics removed as it's a bit long and basically just a bunch of checkboxes with a few buttons at the end):
<asp:Panel class=modal ID=MyPanel runat=server>
<div class=modal-dialog modal-lg style=width:30%>
<div class=modal-content>
<div class=modal-header>
<asp:Label ID=Header runat=server Text=Header />
</div>
<div class=modal-body>
<table>
<tr>
<td style=width: 20px; />
<td>
<asp:Label ID=Label runat=server Text=Stuff: />
</td>
<tr>
</table>
</div>
</div>
</div>
</asp:Panel>
The click event code is being hit as I see it in the debugger, but the modal dialog always closes immediately when I click the button. I can't seem to find anything online to explain why, Googling just gives me a bunch of how do I close a modal on button click type questions. I want to know how to not close it.