- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2016 07:24 AM
I know the onLoad script for automatically displaying More Information text, but was wondering if it's possible to only open it if a field is changed after opening i.e. type of request = 'delete'?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2016 07:48 AM
Your client script would watch the type_of_request variable. The (untested) script would look like this:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if (newValue == 'delete') {
var myVar = g_form.getControl('comments_note');
if(myVar) {
var myVarHelp = $('question_help_IO_' + myVar.id.split(':')[1] + '_toggle');
toggleVariableHelpText(myVarHelp);
}
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2016 07:33 AM
Hi Kevin,
Can you share your onLoad information? I've never seen this done. Theoretically, if you can open it in onLoad, you can open it onChange.
Just for clarification,we're talking about catalog client script working on a variable, right? Or is this a client script working on a field (which doesn't have a More Information bit.)
Thanks.
Creating a Catalog Client Script - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2016 07:38 AM
Hi Chuck,
Here it is:
function onLoad() {
var myVar = g_form.getControl('comments_note');
if(myVar) {
//toggleHelp(myVar.id);
//replaced code as suggested by snc
var myVarHelp = $('question_help_IO_' + myVar.id.split(':')[1] + '_toggle');
toggleVariableHelpText(myVarHelp);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2016 07:41 AM
And yes, I want it to open automatically only if the type_of_request is changed to delete.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2016 07:48 AM
Your client script would watch the type_of_request variable. The (untested) script would look like this:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if (newValue == 'delete') {
var myVar = g_form.getControl('comments_note');
if(myVar) {
var myVarHelp = $('question_help_IO_' + myVar.id.split(':')[1] + '_toggle');
toggleVariableHelpText(myVarHelp);
}
}
}