Updating variable help text dynamically?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-08-2013 12:59 PM
I am looking for a way to dynamically change the help text content for a catalog variable based on value of another variable.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2013 07:11 PM
Thanks Jace. This is exactly what I was looking for.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2013 07:20 AM
The only way I could see you doing this is some DOM manipulation which is not recommended.
If you have to do it you'd have to first create an element you could grab, so your help text would have to be something like
.
<div id="dynamichelp">Default Text goes here</div>
Then you'd have to use your onChange script to find said element, and set the innertext to something else.
You will also need to modify the glide.ui.escape_text property to false;
I modified the script on the OOB iPhone4 item to show you this works, but yea,
You can use prototype (default in servicenow)
function onChange(control, oldValue, newValue, isLoading) {
if (newValue != '' && !isLoading && oldValue != newValue) {
$('dynamichelp').update('Some content goes here until you the dynamic stuff... ' + g_form.getValue("original"));
} else {
$('dynamichelp').update('Some other message');
}
}
I tossed this out on demo004 on the blackberry item, here's a direct link
https://demo004.service-now.com/com.glideapp.servicecatalog_cat_item_view.do?sysparm_id=e2132865c0a8016500108d9cee411699
Right now it's triggering off of the original variable changing.