An anchor loads calls my bootstrap modal as follows
<a class="btn" data-popover="popover" data-content="" data-id="" data-form="das" data-toggle="modal" data-target="#DownloadAsModal"></a>
The bootstrap modal has some checkboxes, which i want to be unchecked each time when the modal loads and so I found a jquery on some posts as
$('#DownloadAsModal').on('show.bs.modal', function () {
$('#jpgCheck').prop('checked', false);
$('#jpgcmykCheck').prop('checked', false);
$('#jpgrgbCheck').prop('checked', false);
}
I could not get the checkbox state to be unchecked. I'm not sure what I'm missing here. I can alert the values returned by the below on a clicking event for a different button and I get proper values true/false
var isJpgChecked = $('#jpgCheck').prop('checked', false);
EDIT 2 Adding the modal which loads the template using the ViewBag populated from a C# controller.
<div class="modal fade modal-wide" id="DownloadAsModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLongTitle">Download Options</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<input type="text" id="mdb_document_id" value="" disabled>
<!-- Content to be loaded here-->
@Html.Raw(HttpUtility.HtmlDecode(@ViewBag.Download_As_Modal_Body))
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" id="Convert">Convert</button>
<button class="btn grey" type="button" data-dismiss="modal"><i class="fa fa-times"></i> @MediabaseUI.GetResourceValue("BtnClose")</button>
</div>
</div>
</div>
</div>
Post I have referred to : stackoverflow, Any tips would be helpful.