How do I show a confirmation dialog when a user checks the Work Notes/Additional Comments checkbox
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2017 09:54 PM
I need to show a confirmation dialog when a user checks the Additional Comments checkbox. The dialog will simply state, are you sure you want to enter customer visible comments.
I have been unable to find a field to put a client script on or any other method of trapping this action.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2017 10:04 PM
Can you please use onChange client script with confirm() method
confirm('Are you sure you want to enter customer visible comments?');
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
//Type appropriate comment here, and begin script below
if(confirm('Are you sure you want to enter customer visible comments?'))
{
//Have your rest of the code here
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2017 10:09 PM
That would be great, what field do I put the onchange client script against. I do not see a field for the checkbox
KEVIN MAURIELLO
Sr. Technical Consultant
INSOURCE | 565 E. Swedesford Road, Suite 220 | Wayne, PA 19087
P. 1 610 592 0800 | C. 1 484 695 3645 | F. 1 610 592 0817
kevin.mauriello@insourcenow.com<mailto:michael.hallman@insourcenow.com> | www.insourcenow.com<http://www.insourcenow.com/> | Connect on LinkedIn<https://www.linkedin.com/in/kjmdeveloper>
INSOURCE: Facebook<https://www.facebook.com/insourceinc/> | Twitter | LinkedIn<https://www.linkedin.com/company/insourceinc/>
ServiceNow Gold Services and Sales Partner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2017 10:14 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2017 10:18 PM
I know that, the Additional Comments field is the actual text field. I need the client script on the checkbox NOT the text field. When the onChange is on the Additional Comments field the event fires for every keystroke in the field. Do you know the field name of the checkbox? That is what needs to have the onchange client script not the Additional Comments text field.