I am trying to hide or show a date and time field based on a checkbox being ticked or not. Currently, I have the below script in OnChange for the checkbox, but it only removes the date box, not the caption or the time box.
if (crm('oppo_aftercarecall').val() == false) { oppo_aftercarecalldate.style.visibility = 'hidden'; } else { oppo_aftercarecalldate.style.visibility = 'visible'; }
The other problem with this is that it doesn't hide the date/time field by default when the checkbox isn't ticked.
Can anyone suggest the best way to achieve this in CRM 2018 R3?