I wanna create my checkbox to be check when the button on my modal has been click rather that clicking it. That the checkbox are disable and unchecked. That the button make the modal dismiss or close and make the checkbox automatically check. The following codes at the bottom I am using right now.
$("#checkbox").prop("disabled", true);
<script src="http://ift.tt/2nfnDrE"></script>
<script src="http://ift.tt/2aHTozy"></script>
<link href="http://ift.tt/2apRjw3" rel="stylesheet"/>
<!-- Button trigger modal -->
<button class="btn btn-success btn-sm" data-toggle="modal" data-target="#myModal">
Open Modal
</button>
<div class="checkbox">
<label>
<input type="checkbox" id="checkbox" name="checkbox"> Check me out
</label>
</div>
<div id="myModal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Modal title</h4>
</div>
<div class="modal-body">
<p>Ang Lorem Ipsum ay ginagamit na modelo ng industriya ng pagpriprint at pagtytypeset. Ang Lorem Ipsum ang naging regular na modelo simula pa noong 1500s, noong may isang di kilalang manlilimbag and kumuha ng galley ng type at ginulo ang pagkaka-ayos nito upang makagawa ng libro ng mga type specimen. Nalagpasan nito hindi lang limang siglo, kundi nalagpasan din nito ang paglaganap ng electronic typesetting at nanatiling parehas. Sumikat ito noong 1960s kasabay ng pag labas ng Letraset sheets na mayroong mga talata ng Lorem Ipsum, at kamakailan lang sa mga desktop publishing software tulad ng Aldus Pagemaker ginamit ang mga bersyon ng Lorem Ipsum.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success " data-dismiss="modal">Agree</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
Aucun commentaire:
Enregistrer un commentaire