Hiding Sections on Forms

One method is to use the physical order in which a section appears on a tab (starting at number 0).

// This hides section number 1 on tab 0, i.e. the second section on the first tab

HideSection( 0 , 1 , "none" );
function HideSection( tabIndex , sectionIndex , displayType )
{
var tab2Hide = document.getElementById( "tab" + tabIndex );
tab2Hide.childNodes[0].rows[ sectionIndex ].style.display = displayType;
}

Another option is to use an attribute in the section to get a reference to the section itself by using code of the form:

crmForm.all.new_attribute.parentElement.parentElement.style.display='none';

where new_attribute is an attribute in the section. However, it seems that whether the section name is displayed has a bearing on whether this will work.

If it is, the code needs to be this:

crmForm.all.new_attribute.parentElement.parentElement.parentElement.style.display='none';

 

CRM Topics: 
CRM Versions: