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

Notifications

Announcements

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Jerry-IN Profile Picture

Jerry-IN 71

#2
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard