web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / A Datetime Picker shou...
Power Pages
Unanswered

A Datetime Picker should be closed when another one is opened, instead multiple instances of Datetime Picker remain open at the same time! Pics included

(0) ShareShare
ReportReport
Posted on by 520

I have 2 Datetime pickers

Robert94_0-1662125944596.png

The normal behaviour expected would be, when one datetime picker is opened, and we open another one, the first one will close,

instead if we click on both buttons, both datetime picker will remain opened,

Robert94_1-1662125996691.png

I would want to behave, when clicking a datetime picker, similar to when clicking o the background, which means to close the other datetime picker that is opened.

Categories:
I have the same question (0)
  • H V Profile Picture
    1,510 on at

    Hi @Robert94 

     

    Please use below code:

    $(document).ready(function(){
    	$("#scheduledstart").closest("div").find(".input-group-addon").click(function(){
    		$('#scheduledend').next().data("DateTimePicker").hide()
    	});
    
    	$("#scheduledend").closest("div").find(".input-group-addon").click(function(){
    		$('#scheduledstart').next().data("DateTimePicker").hide()
    	});
    });

     

    --------------------------
    If you like this post, give a Thumbs up. Where it solved your query, Mark as a Solution so it can help other people!

  • Robert94 Profile Picture
    520 on at

    Hi @hardikv , I appreciate your response, unfortunately, I couldn`t make it work, I also tried with the inspect console, and it is still not working? Is it something I have to modify to the code for my case? Did it work for you?

    I`ve pasted it in the custom JS of Webpage, and then in the custom JS of the Basic Form.

  • H V Profile Picture
    1,510 on at

    Hi @Robert94 

     

    You need to replace scheduledstart with your first field logical name and scheduledend with your second field logical name.

     

    --------------------------
    If you like this post, give a Thumbs up. Where it solved your query, Mark as a Solution so it can help other people!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
Valantis Profile Picture

Valantis 58

#2
11manish Profile Picture

11manish 49

#3
Haque Profile Picture

Haque 28

Last 30 days Overall leaderboard