
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2014 08:40 PM
How do I modify the Help Label of Form Fields With Client Scripts? I have a requirement that I dynamically modify the label of a variable in the Service Catalog. I have found plenty of help to accomplish this:
https://community.servicenow.com/message/714821
http://www.servicenowguru.com/system-ui/field-styles-service-catalog-variables/
With the suggestions in these resources, I am able to modify the label using Catalog Client Scripting. But I can't figure out how to dynamically modify the help label (normally shown as "More Information" adjacent to the label). Does anyone know how to do this?
Thank you!
Solved! Go to Solution.
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2014 10:13 AM
Hi Larry,
Try this
var variableID = g_form.getControl('variableName').id;
var labelElement = gel('help_'+variableID +'_wrapper');
labelElement.select('td').each(function(elmt) {
if(elmt.className == '')
elmt.innerHTML = "What text you want";
});
Thanks and regards,
Pratik Limbore

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2014 09:41 PM
Thanks, Pratik. I used your code to create a UI Script that actually will change the help text that appears when the "More Information" link is clicked on a catalog variable. I can call this UI Script from a Catalog Client Script. (I combined your idea with the ideas from the others who helped me.)
Here is the UI Script I created that works (I am using Eureka):
function changeCatalogVariableHelpLabel(field, label, color, weight){
try{
var variableID = g_form.getControl(field).id;
var labelElement = gel('help_'+variableID +'_wrapper');
labelElement.select('td').each(function(elmt) {
if(elmt.className == ''){
elmt.innerHTML = label;
}
});
if(color)
labelElement.style.color = color;
if(weight)
labelElement.style.fontWeight = weight;
}catch(e){}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-26-2017 03:49 PM
Hello,
I just wanted to run an 'update' to this answer. I got this to work but it seems that in Geneva and later (I have a Fuji instance) you need to get rid of "sys_original" that is a prefix to the ID.
var variableID = g_form.getControl(field).id;
var fixedID = variableID.replace("sys_original.", "");
Then you could go ahead and do:
var labelElement = gel('help_'+ fixedID +'_wrapper');
and the code should work now. Thank you for the solution, this helped me out. You could also reference Show/Hide Service Catalog Variable Help Text - ServiceNow Guru as that is where I got my answer. Thanks all!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2017 10:17 AM
Do you have a full script that will work in the Service Portal?
I am just trying to change a variable label in an OnChange script, but can't find anything that works in the Service Portal.
Please mark this response as correct and/or helpful if it assisted you with your question.
Steven
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2017 11:47 AM
Sorry I do not. I am just now starting to develop for the Service Portal. If I find a solution while I go along, I will make sure to follow up. My apologies and good luck!