Creating a OK/Cancel dialog box
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2012 06:57 AM
Hi everyone, I created a simple UI action that works the way it should. When a user clicks on the button, I want them to be greeted with an OK or Cancel dialog box. Ok would continue with the action and cancel would obviously keep them on the same screen. I know how to script a dialog box, but it doesnt appear that it works in service now? is there some method is servicenow that I need to use to accomplish this? Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2012 07:01 AM
You can use "confirm" in client script.
var c = confirm ('Please review the information below and select OK to finish submitting your request');
if (c)
{
return true;
}
else
{
return false;
}
}
Regards,
ND
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2012 07:02 AM
i am guessing that you are calling a UI page from your UI Action. If this is the case, then in the g: tag which calls this button have a return before calling the function. for example:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2012 07:05 AM
Here is example tag
<input type="button" id="myButton" onclick='return myFunction()"/>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2012 07:10 AM
Thanks for the suggestions guys. I got it to work. Appreciate it!