How to display a confirmation Pop up in Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2022 04:25 AM
Hi Team,
We have a catalog item and user will be filling the details in the catalog item form in service portal. While user is submitting the request it should display the message stating "Are you sure to submit the request: requested for" and it should contain ok and cancel button. If user is selecting ok it should submit the request. If user is selecting cancel then it should be in the same page. Kindly help me to achieve this,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2022 02:58 AM
Hi Chris,
It is allowing us to submit the request. Could you please help me on this.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2022 05:50 AM
I thought you had previously said that the script was working as expected, the only issue was that it was not displaying the name of the Requested for user?
If this answer is helpful please mark correct and helpful!
Regards,
Christopher Perry
Regards,
Chris Perry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2022 10:22 AM
Yes it is not displaying name and also pop up is not getting displayed

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2022 10:34 AM
Can you please share the script you are using?
If this answer is helpful please mark correct and helpful!
Regards,
Christopher Perry
Regards,
Chris Perry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2022 11:45 AM
Hi Chris,
function onSubmit() {
//var name=g_form.getReference('requested_for').name;
//Type appropriate comment here, and begin script below
if (g_scratchpad.isFormValid) {
return true;
}
//var popup = confirm('Are you sure you want to offboard the user:');
var popup = confirm('Are you sure to submit the request ' + g_form.getReference('requested_for').name + '?');
if (!popup) {
g_scratchpad.isFormValid = false;
return false;
} else {
g_scratchpad.isFormValid = true;
g_form.submit(g_form.getActionName());
return false;
}
}