How to hide/show a section

Requirement: Show resolution section only when state is “Resolved/Closed”in incident form

If you want to hide a form section, you need to create a client script.

Name: Show/hide resolution section
Table: Incident
Type: Onchange
Field name: State
Script:

function onChange(control,newValue,oldValue,isLoading){
if (isLoading)
{
return;
}
var sections = g_form.getSections();
var state = g_form.getValue(‘state’);
if (state == ‘6’|| state==’7′)
{
sections[3].style.display = ‘block’;
}
else
{
sections[3].style.display = ‘none’;
}
}