Why is g_form.setLabelOf() not working?

dalton1
Giga Expert

Hi,

I am trying to change the label text value for one of the variables in my catalog item. Nothing happens when I navigate to my item but getLabelOf seems to work fine.

Pradeep Sharma
ServiceNow Employee

Hi Dalton,



Can you please let me know on which fuji patch you are trying this.


paulmorris
Giga Sage

Can you provide the line of code that is failing?



ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

Hi Paul Morris Pradeep Sharma,


Below is the code:



function enableMultipleUsers(param){


        if(param.getAttribute('name')=='Individual'){


                  param.setAttribute('name','Multiple'); param.innerHTML = "Enroll individually (Individual Enrollment)";                     g_form.setLabelOf('u_primary_owner','Secondary Owner');


        }


        else{


                  param.setAttribute('name','Individual'); param.innerHTML = "Enroll multiple users (Bulk Enrollment)";                     g_form.setLabelOf('u_primary_owner','Primary Owner');


        }


}




Multiple Users.PNG



Multiple Users1.PNG


Hi Daltion,



On which Fuji patch you are trying this.