
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-19-2015 07:39 AM
I have a catalog form that contains a field asking what type of member are you trying to Onboard, I want to create a confirmation popup box that says something like "Are you sure this is the type of member you want to onboard? ". I would like the confirmation pop up to be a Yes or No, and if No then reset that field back to the default of "none". I want the pop up to occur upon Submission of the form or is there a way to have it appear after one of the selections is made.
I know that I can use a confirm type of script like: confirm("Hello World"); Will pop up a window with "Hello World?" and a 'Ok' and 'Cancel' buttons.
Is that done thru the gs.addInfoMessage("Hello World"); Will put "Hello World" on the top of the screen
Please assist if you can and I will need some assistance with the javascript that may be required.
Thanks again.
Karen
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-19-2015 10:26 AM
onChange client script for the field in question. Here's the code:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue == '') {
return;
}
var con = confirm("Are you sure this is the type of member you want to onboard?");
if(con == false)
control.value = oldValue; //This can also be simply an open and close apostrophe '' to bring it back to None.
}
That should do it for you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-19-2015 07:54 AM
hi Karen,
For this requirement you need to go for glidedialogwindow.
Please follow the following steps:-
1.create one onChange client script and render that glidedialogwindow(it will call the UI Page) based on work force member type.
2. you have to create the uI page that should contain the confirmation message.
Please refer the below link.
Displaying a Custom Dialog - ServiceNow Wiki
Please let me know if u need any more input.
Thanks
Prakash Ranjan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-19-2015 10:12 AM
Hi,
what about a jQuery component: http://jqueryui.com/dialog/#modal-confirmation
This should make it for you together with the onChange client script on that specific field with the code similar to following:
$("#dialog-confirm").dialog({
resizable: false,
height: 140,
modal: true,
buttons: {
"Yes": function() {
$(this).dialog("close");
},
"No": function() {
// reset the value of the field here..
$(this).dialog("close");
}
}
});
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-19-2015 10:26 AM
onChange client script for the field in question. Here's the code:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue == '') {
return;
}
var con = confirm("Are you sure this is the type of member you want to onboard?");
if(con == false)
control.value = oldValue; //This can also be simply an open and close apostrophe '' to bring it back to None.
}
That should do it for you.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2015 06:38 AM
Thank you again Joshua - this worked perfectly.