Solved

Grey out control (date field) if date is less than TODAY

  • 12 April 2023
  • 6 replies
  • 139 views

Userlevel 1
Badge +9

Hello!

Ok, where do I begin... So! I have been racking my brain for days now in trying to figure out how to grey out a field based on another field.

I have a “request date” field that auto populates when a form opens up. I need to grey out the “Due Date for law review” field if the date that is entered in is less than 14 days from the request date….

I cannot for the life of me find out how to do this and have not been successful in researching on google as everyone’s situation is different.

Your help and examples are greatly appreciated!

Thanks!

 

icon

Best answer by Garrett 12 April 2023, 17:40

View original

6 replies

Userlevel 6
Badge +16

Hi @jpacheco 

Just to confirm, you are using the New Responsive Form, right?

 

What do you mean by grey out? Make the field read-only or just make the control background fill color as grey

Userlevel 1
Badge +9

@Garrett ,

Hi!!

Yes, grey out = Read-Only and I am using the “Nintex Forms for Office 365” (looks to be responsive, see below).

I want to make the Due Date field read-only.

So if in the Due Date field someone selects a date that is “- 14 days” (less than) from the Request Date, they cannot enter anything in… Thnx for your quick response!

 

Userlevel 6
Badge +16

Hi @jpacheco 

 

The show time is enabled for both Date controls.

The Due Date restricts past dates

 

You can use the “DateDiff()” formula in the Form Rules.
dateDiff("TotalDays",[Form].[Request Date],[Form].[Due Date]).
This will return a number value which you can use for comparison.

 

PS: If you make DueDate field as read-only (< 14 days), users will not be able to update the DueDate field.

 

Userlevel 1
Badge +9

@Garrett ,

Hey thanks so much for you promptness and help!! I’m going to try this out and will update this as soon as I test!

 

Thanks again!

Userlevel 1
Badge +9

@Garrett, YOU ROCK!!! This really helped me and I’m extremely grateful for your help in this! Thank you!!

Userlevel 6
Badge +16

Hi @jpacheco 

You’re welcome. Just glad that I was able to help you. 

Reply