Javascript
I have code that will hide various sections in a MS CRM form based on the value of a Picklist. The code executes in the onChange event of the Picklist. It hides the section by referencing a field in the section and then navigating up the DOM using the ParentElement syntax, as such:
crmForm.all.fieldName.parentElement.parentElement.parentElement.style.display = 'none';
This seems to work, with 1 exception. The offending section has a single read-only field, which I assume is the cause. No error is thrown. I've also tried variations with 2 and 4 ".parentElement" blocks.
How can I hide this section?