hide a section on change request form

sharley
Tera Contributor
I am trying to hide a section i created on change_request form when the change type is not chosen as "A" and make it visible only when change type is chosen as "A".
 
Client script:
function onLoad(control, oldValue, newValue, isLoading, isTemplate) {
   if (isLoading || newValue === '') {
var type = g_form.getValue(type);
if (type = 'A'){
    g_form.setSectionDisplay("A", true);
}
else {
    g_form.setSectionDisplay("A", false);
}
      return;
   }
   //Type appropriate comment here, and begin script below
   
}
10 REPLIES 10

@sharley 

Hope you are doing good.

Did my reply answer your question?

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader