cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Advocate V
Advocate V

Only show message when past date is selected.

Happy Friday!

 

Trying to figure out how to have the message "Only" display only when a user select a day in the past, In addition have the submit button disable.

DatePicker1.BorderColor: If(DatePicker1.SelectedDate < Today(), Color.Red, RGBA(101, 128, 187, 1))
Warning.Text: "Dates in the past cannot be selected"
Warning.Color: Color.Red
Warning.Visible: DatePicker1.SelectedDate < Today()

 

Timeline.PNG

 

I hope I've explained myself clearly. Thank you in advance.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Dual Super User II
Dual Super User II

Hi @oappdev 

 

BorderColor

If(!IsBlank(DatePicker1.SelectedDate) && DatePicker1.SelectedDate < Today(), Color.Red, RGBA(101, 128, 187, 1))

 

Warning

IsBlank(DatePicker1.SelectedDate) ||  DatePicker1.SelectedDate < Today()

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Thanks,
Reza Dorrani, MVP
YouTube
Twitter

View solution in original post

Super User III
Super User III

@oappdev 

To have the message "Only" display only when a user select a day in the past... it looks like you've already done this.

 

Warning.Visible: DatePicker1.SelectedDate < Today()

 

You can make the submit button disable by changing the DisplayMode property to this code.

 

If(DatePicker1.SelectedDate < Today(), DisplayMode.Disabled, DisplayMode.Edit)

 

Note:  I did not see that RezaDorrani had already posted but I think my DisplayMode code is part of the solution you'll need.  If it works you can always accept both our answers as the solution.

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

6 REPLIES 6
Dual Super User II
Dual Super User II

Hi @oappdev 

 

BorderColor

If(!IsBlank(DatePicker1.SelectedDate) && DatePicker1.SelectedDate < Today(), Color.Red, RGBA(101, 128, 187, 1))

 

Warning

IsBlank(DatePicker1.SelectedDate) ||  DatePicker1.SelectedDate < Today()

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Thanks,
Reza Dorrani, MVP
YouTube
Twitter

View solution in original post

Thank you @RezaDorrani , Will circle back.

Super User III
Super User III

@oappdev 

To have the message "Only" display only when a user select a day in the past... it looks like you've already done this.

 

Warning.Visible: DatePicker1.SelectedDate < Today()

 

You can make the submit button disable by changing the DisplayMode property to this code.

 

If(DatePicker1.SelectedDate < Today(), DisplayMode.Disabled, DisplayMode.Edit)

 

Note:  I did not see that RezaDorrani had already posted but I think my DisplayMode code is part of the solution you'll need.  If it works you can always accept both our answers as the solution.

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Thank you @mdevaney 

 

 

 

Thank you @RezaDorrani

Accepted your solution ✔️

Thank you @mdevaney 

Accepted your solution ✔️ for disable submit button.

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (52,972)