"model with javascript and checkbox"
Bootstrap 3.0.0 Snippet by sandeep021

<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <h2>Modal Login Example</h2> <!-- Trigger the modal with a button --> <input id='myBtn' name='test' type='radio' checked /> Radio 1 <input id='myBtn1' name='test' type='radio' /> Radio 2 <input id='myBtn2' name='test' type='radio' /> Radio 3 <!-- Modal --> <div class="modal fade" id="myModal" role="dialog"> <div class="modal-dialog"> <!-- Modal content--> <div class="modal-content"> <div class="modal-header" style="padding:35px 50px;"> <button type="button" class="close" data-dismiss="modal">×</button> <h4><span class="glyphicon glyphicon-lock"></span> Login</h4> </div> <div class="modal-body" style="padding:40px 50px;"> <form role="form"> <div class="form-group"> <label for="usrname"><span class="glyphicon glyphicon-user"></span> Username</label> <input type="text" class="form-control" id="usrname" placeholder="Enter email"> </div> <div class="form-group"> <label for="psw"><span class="glyphicon glyphicon-eye-open"></span> Password</label> <input type="text" class="form-control" id="psw" placeholder="Enter password"> </div> <div class="checkbox"> <label><input type="checkbox" value="" checked>Remember me</label> </div> <button type="submit" class="btn btn-success btn-block"><span class="glyphicon glyphicon-off"></span> Login</button> </form> </div> <div class="modal-footer"> <button type="submit" class="btn btn-danger btn-default pull-left" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span> Cancel</button> <p>Not a member? <a href="#">Sign Up</a></p> <p>Forgot <a href="#">Password?</a></p> </div> </div> </div> </div> <!-- Modal1 --> <div class="modal fade" id="myModal1" role="dialog"> <div class="modal-dialog"> <!-- Modal content--> <div class="modal-content"> <div class="modal-header" style="padding:35px 50px;"> <button type="button" class="close" data-dismiss="modal">×</button> <h4><span class="glyphicon glyphicon-lock"></span> Login1</h4> </div> <div class="modal-body" style="padding:40px 50px;"> <form role="form"> <div class="form-group"> <label for="usrname"><span class="glyphicon glyphicon-user"></span> Username</label> <input type="text" class="form-control" id="usrname" placeholder="Enter email"> </div> <div class="form-group"> <label for="psw"><span class="glyphicon glyphicon-eye-open"></span> Password</label> <input type="text" class="form-control" id="psw" placeholder="Enter password"> </div> <div class="checkbox"> <label><input type="checkbox" value="" checked>Remember me</label> </div> <button type="submit" class="btn btn-success btn-block"><span class="glyphicon glyphicon-off"></span> Login</button> </form> </div> <div class="modal-footer"> <button type="submit" class="btn btn-danger btn-default pull-left" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span> Cancel</button> <p>Not a member? <a href="#">Sign Up</a></p> <p>Forgot <a href="#">Password?</a></p> </div> </div> </div> </div> <!-- Modal2 --> <div class="modal fade" id="myModal2" role="dialog"> <div class="modal-dialog"> <!-- Modal content--> <div class="modal-content"> <div class="modal-header" style="padding:35px 50px;"> <button type="button" class="close" data-dismiss="modal">×</button> <h4><span class="glyphicon glyphicon-lock"></span> Login2</h4> </div> <div class="modal-body" style="padding:40px 50px;"> <form role="form"> <div class="form-group"> <label for="usrname"><span class="glyphicon glyphicon-user"></span> Username</label> <input type="text" class="form-control" id="usrname" placeholder="Enter email"> </div> <div class="form-group"> <label for="psw"><span class="glyphicon glyphicon-eye-open"></span> Password</label> <input type="text" class="form-control" id="psw" placeholder="Enter password"> </div> <div class="checkbox"> <label><input type="checkbox" value="" checked>Remember me</label> </div> <button type="submit" class="btn btn-success btn-block"><span class="glyphicon glyphicon-off"></span> Login</button> </form> </div> <div class="modal-footer"> <button type="submit" class="btn btn-danger btn-default pull-left" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span> Cancel</button> <p>Not a member? <a href="#">Sign Up</a></p> <p>Forgot <a href="#">Password?</a></p> </div> </div> </div> </div> </div>
.modal-header, h4, .close { background-color: #5cb85c; color:white !important; text-align: center; font-size: 30px; } .modal-footer { background-color: #f9f9f9; }
$(document).ready(function(){ $("#myBtn").click(function(){ if($('#myBtn').prop('checked')===true) { $("#myModal").modal(); } }); $("#myBtn1").click(function(){ if($('#myBtn1').prop('checked')===true) { $("#myModal1").modal(); } }); $("#myBtn2").click(function(){ if($('#myBtn2').prop('checked')===true) { $("#myModal2").modal(); } }); });

Related: See More


Questions / Comments: