Total Blog Views: 48
Blog Status: publish
Created By: swazahmad Created at: 09-04-2021
Tags: datepicker with boostrap modal datepicker with bootstrap datepicker
Below is The Working Demo for Datepicker with Bootstrap modal
Add Below Script to add Date picker in Script Tag
$( function() { $( "#datepicker" ).datepicker(); }); $("[id=add]").click(function() { $("#myModal .modal-header h4").html("Request for Change"); $("#myModal").modal("show"); }); $(".date-picker").datepicker({ orientation: "top", beforeShow: function(input, obj) { $(input).after($(input).datepicker('widget')); } }); $(".date-picker").focus(function (){ $("#ui-datepicker-div").position({ my: "center top", at: "center bottom", of: $(this) }); }); .datepicker-container{ position: relative !important; }
Add Below Line In Header
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> <script src="https://code.jquery.com/jquery-1.12.4.js"></script> <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
Add Below Line In Body:
<div class="well"> <button type="button" id="add">Add</button> </div> <div id="myModal" class="modal"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <h4></h4> </div> <div class="modal-body"> <label class="label">Date picker</label> <div class="datepicker-container"> <input class="form-control datePicker date-picker" id="datepicker" placeholder: "MM/YYYY"> </div> <h1>helllo</h1> <h1>helllo</h1> <h1>helllo</h1> <h1>helllo</h1> <h1>helllo</h1> <h1>helllo</h1> <h1>helllo</h1> <h1>helllo</h1> <h1>helllo</h1> <h1>helllo</h1> <h1>helllo</h1> <h1>helllo</h1> <h1>helllo</h1> <h1>helllo</h1> <h1>helllo</h1> <h1>helllo</h1> <h1>helllo</h1> <h1>helllo</h1> <h1>helllo</h1> <h1>helllo</h1> <h1>helllo</h1> <h1>helllo</h1> <h1>helllo</h1> <h1>helllo</h1> <h1>helllo</h1> <h1>helllo</h1> <h1>helllo</h1> <h1>helllo</h1> <h1>helllo</h1> <h1>helllo</h1> </div> </div> </div> </div>
we have the “Get things executed” lifestyle at our place of work. There are not any excuses, no if’s or however’s in our dictionary. committed to navigating the ship of creativity to create cell answers, we resolve the real-lifestyles troubles of our clients and their clients. Our passion for work has won us many awards, year after 12 months.
© Copyright Shadbox. All Rights Reserved
Rate Blog :
Share on :
Do you have any blog suggestion? please click on the link