
- 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-18-2014 10:13 PM
It could be done with this bit of JavaScript in a Catalog Client Script:
try{
var helpId = "label_help_" + g_form.getControl("your_variable_name_here").name.toString();
var control = $(helpId);
control.innerHTML = control.innerHTML.replace("More information", "whatever text you want");
} catch(err) {}
The problem is if you have to modify it repeatedly, you'll have to keep track of what you keep changing it to.
I'm wondering if you could use a Field Message instead - http://wiki.servicenow.com/index.php?title=Display_Field_Messages. It would be less of a hack and less prone to problems.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2014 09:17 AM
Thanks, Jim. I talked with my customer and they agreed that your suggestion to use a Field Message would be an acceptable approach. We will leave the More Information off of the field and just use an info message.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2014 09:57 AM
You are welcome. Could you please click the "Correct Answer" button on the appropriate response so others can see that you've found an acceptable answer to your question. Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2014 01:23 PM
I try to use as much out of the box functionality as I can in order to avoid upgrade issues in the future.