How to display a confirmation Pop up in Service Portal

Arun87
Giga Contributor

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,

 

19 REPLIES 19

Hi Chris,

It is allowing us to submit the request. Could you please help me on this.

 

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

If this answer is helpful please mark correct and helpful!

Regards,
Chris Perry

Yes it is not displaying name and also pop up is not getting displayed

Can you please share the script you are using?

If this answer is helpful please mark correct and helpful!

Regards,

Christopher Perry

If this answer is helpful please mark correct and helpful!

Regards,
Chris Perry

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;
}
}