Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

DOM alternative

pswapnil320
Tera Contributor

Can anyone suggest replacement functions for DOM manipulation technique (e.g. gel, document) in Client script.

 

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
   if (isLoading || newValue === '') {
      return;
   }
     g_form.getReference('u_source_cost_center', applyCostCenterStyle);

    function applyCostCenterStyle(cost_center) {
        if (cost_center.u_active == 'true')
            return;
        try {
            var elementID = gel('sys_display.' + g_form.getTableName() + '.' + 'u_source_cost_center');
            elementID.style.color = "red";
        } catch (ex) {}
    }
}

 

0 REPLIES 0