Bootstrap Datepicker Trigger Change Event Example
I was working on my codeigniter application and i used bootstrap 3. i also used bootstrap datepicker js on it. Same time i need to trigger change event of bootstrap datepicker on page load. i can set default date on datepicker but i have issue to trigger date change event in bootstrap datepicker.
Finally, i found the solution to trigger change event of bootstrap datepicker plugin. we can trigger bootstrap datepicker change event by using 'changeDate' of that element. you can see following example to make it done.
Example:
$('#event_date').datepicker({
autoclose: true,
format: 'mm/dd/yyyy',
daysOfWeekDisabled: "6,0",
language: "en"
}).on('changeDate', function(e) {
console.log('changeDate event trigger');
});
/* Trigger on load or any where */
$('#event_date').trigger('changeDate');
I hope it can help you....
Hardik Savani
I'm a full-stack developer, entrepreneur and owner of ItSolutionstuff.com. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Laravel, Angular, Vue, Node, Javascript, JQuery, Codeigniter and Bootstrap from the early stage. I believe in Hardworking and Consistency.
We are Recommending you
- Bootstrap Datepicker Get Date on Change Event Example
- Bootstrap Color Picker using Mjolnic Colorpicker Example
- Bootstrap Year Picker using Datepicker JS Example
- AngularJS Simple Datepicker Directive Example Tutorial
- Bootstrap Notification Popup Box using Bootstrap-growl JS Example
- How to Change View Mode in Bootstrap Datepicker Like yyyy-mm?
- JQuery Datepicker Example using JQuery UI JS
- JQuery Bootbox Modal Dialog Prompt Example
- Bootstrap Dynamic Autocomplete search using Typeahead JS
- Bootstrap Datepicker Change Date Format Example
- Bootstrap Colorpicker Example Code
- Bootstrap Timepicker using Datetimepicker JS Example
- How to Use Collapse Example in Bootstrap?
- How to use Datepicker in Bootstrap?