Some PDIs are currently unavailable, and PDI actions are paused. View the latest updates here. Read More

How to Greyed Out past dates for a Date type variable

Dan33
Tera Contributor

Hi All,

Can anyone please help to grey out past dates for Date type variable on Portal and Classic view.

 I don't want to change my variable into widget. Is there any other way to do it? 

I am doing validation on it but i need it to be greyed out.

Thanks in advance.

7 REPLIES 7

Thanks.

Omkar Mone
Mega Sage

Hi Dan,

 

Currently there is no attribute for the date variable to make the past dates read-only or greyed out. Though this a good enhancement that can be considered. In HTML for an input type="date" when we provide the min attribute to todays date or whichever date we want, the dates before the mentioned date will be greyed out. 

 

For now i would suggest you to put a validation on that field that if someone selects a date which is in past it should give them a pop up or an alert saying "Past dates cannot be selected"  and clear the field value which will again make it mandatory for user to fill.

 

Hope this helps.

 

Regards,

Omkar Mone

Dan33
Tera Contributor

i did it. I was able to add error message but I am looking some other solution for that. I think there a possible way in variable field type UI MACRO. But I don't wanna create the widget now as there are so many field depending on this Date field. I don't want to change other scripts for this. So i was looking for a possible way.