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.

1 ACCEPTED SOLUTION

HI Dalton Claudio



Here is an update. I've just checked the problem and it looks like this is fixed on fuji patch 3. I've verified the same on my instance patch 3 and it works fine there.


Please let me know if you have any questions.


View solution in original post

12 REPLIES 12

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Dalton,



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


The SN Nerd
Giga Sage
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.