Background
Break News
How to add local font to Tailwind Css and NextJS? - Tutorial Design Pattern? - Blockchain Technology, How to create own Bitcoin virtual currency - Zustand mordern management state - Design Pattern - Flyweight Pattern? - Docker Full training Topic

[Solved] Bootstrap Datetimepicker OnChange event (WORKING)

Wednesday 18 May 2022
|
Read: Completed in minutes

[Solved] Bootstrap Datetimepicker OnChange event (WORKING)

Hello everyone, welcome back to Learn Tech Tips blogspot

Today topic is show you how to fix bug OnChange event not working with Bootstrap 4Datetimepicker 

Bootstrap Datetimepicker OnChange event (WORKING)


Tiktok 






If you are working with Bootstrap datetimepicker and you want to trigger onChange value on datetimepicker event, how do you do it? 

(This topic is using Bootstrap 4.4.1 and Datatimepicker v4) Yeah, when you search out my topic, Congratulation, finally you had found the answer, Same as you I had been found many answers from many page as stackoverflow, as many topic, .....  but no luck. 

Finally I had found the best answer after take half days researching and trying many method. For save your time research and finding answer bootstrap datetimepicker onChange event. So I want to share with you guys my answer. I think it will help you so much when you woring on change event for bootstrap datetimepicker

Ok, Don't waste the time now, let's start!!!

[Solved] Bootstrap Datetimepicker OnChange event (WORKING)

Actually use onChange event on Datetimepicker with below detail soure code

Include: (about library you can download on my github)



  <link href="css/bootstrap.min.css" rel="stylesheet"></link>
  <script src="js/jquery.min.js"></script>
  <link href="css/tempus-dominus-bootstrap4.min.css" rel="stylesheet"></link>
  <link crossorigin="anonymous" 
       href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" 
       integrity="sha512-KfkfwYDsLkIlwQ
                 p6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==" 
       referrerpolicy="no-referrer" rel="stylesheet"></link>


HTML:


<div class="form-group">
   <div class="input-group date" id="datetimepicker1" data-target-input="nearest">
     <input type="text" class="form-control datetimepicker-input" 
     		data-target="#datetimepicker1" />
     <div class="input-group-append" data-target="#datetimepicker1" 
     		data-toggle="datetimepicker">
       <div class="input-group-text">
       		<i class="fa fa-calendar"></i></div>
     </div>
    </div>
</div>

Javascript


$(document).ready(function () {
   $("#datetimepicker1").datetimepicker({
       format: 'YYYY-MM-DD',
    });

   $("#datetimepicker1").on("change.datetimepicker", ({ date, oldDate }) => {
       $('#current_date').text(date);
       $('#old_date').text(oldDate);
    });
});


You can get my source code from here

If you have any feedback or questions about bootstrap datetimepicker onchange event not working, leave your comment we can discuss about it

See you all

Learn Tech Tips - Zidane

Thanks for tempus dominus for show me how to integrated bootstrap 4 with Datetimepicker

 







🙇🏼 We Appreciate Your Comments and Suggestions - Webzone - all things Tech Tips web development 🙇🏼
Popular Webzone Tech Tips topic maybe you will be like it - by Webzone Tech Tips - Zidane
As a student, I found Blogspot very useful when I joined in 2014. I have been a developer for years . To give back and share what I learned, I started Webzone, a blog with tech tips. You can also search for tech tips zidane on Google and find my helpful posts. Love you all,

I am glad you visited my blog. I hope you find it useful for learning tech tips and webzone tricks. If you have any technical issues, feel free to browse my posts and see if they can help you solve them. You can also leave a comment or contact me if you need more assistance. Here is my blog address: https://learn-tech-tips.blogspot.com.

My blog where I share my passion for web development, webzone design, and tech tips. You will find tutorials on how to build websites from scratch, using hot trends frameworks like nestjs, nextjs, cakephp, devops, docker, and more. You will also learn how to fix common bugs on development, like a mini stackoverflow. Plus, you will discover how to easily learn programming languages such as PHP (CAKEPHP, LARAVEL), C#, C++, Web(HTML, CSS, javascript), and other useful things like Office (Excel, Photoshop). I hope you enjoy my blog and find it helpful for your projects. :)

Thanks and Best Regards!
Follow me on Tiktok @learntechtips and send me a direct message. I will be happy to chat with you.
Webzone - Zidane (huuvi168@gmail.com)
I'm developer, I like code, I like to learn new technology and want to be friend with people for learn each other
I'm a developer who loves coding, learning new technologies, and making friends with people who share the same passion. I have been a full stack developer since 2015, with more than years of experience in web development.
Copyright @2022(November) Version 1.0.0 - By Webzone, all things Tech Tips for Web Development Zidane
https://learn-tech-tips.blogspot.com