ebs.confirm
(FintechOS Studio 20.2.1 and later)
Displays a modal window with two buttons (a confirmation window).
Syntax
Copy
function ebs.confirm(options: IEbsConfirmOptions, yesFunction: Function, noFunction: Function): void;
| Parameter | Type | Description |
|---|---|---|
options
|
IEbsConfirmOptions | Settings for the title, message, and button labels. |
yesFunction (optional) |
function | Callback function to run when pressing the confirmation button. |
noFunction (optional) |
function | Callback function to run when pressing the rejection button. |
Type Aliases
JSON object containing details about the title, message, and labels for the buttons.
Copy
{
title?: string;
message?: string;
yesButtonLabel?: string;
noButtonLabel?: string;
}
| Property | Type | Description |
|---|---|---|
title (optional) |
string | Tile of the confirmation window. Default: Confirmation. |
message (optional) |
string | Content of the confirmation window. You can use HTML markup for formatting. Default: Are you sure? |
yesButtonLabel(optional)
|
string | Label displayed on the confirmation button. Default: Yes. |
noButtonLabel(optional)
|
string | Label displayed on the rejection button. Default. No. |
Examples
In this example, we create a cookie consent confirmation window with the following features:
- We create a function called manageCookies to redirect the user to the https://www.mywebsite.com/cookies-policy in case of refusal. For details on how to navigate to a URL, see ebs.goToUrl.
- The confirmation window title is Cookie Consent.
- The confirmation window message is We use cookies. This site uses cookies to offer you a better browsing experience. By continuing to use our site, you consent to the use of cookies.
- The label used to close the alert window and proceed is I agree.
- The label used to redirect the user to the cookies policy page is Manage cookies.
Copy
function manageCookies(){
ebs.goToUrl('https://www.mywebsite.com/cookies-policy')
}
ebs.confirm(
{
title: 'Cookie Consent',
message: '<h1>We use cookies</h1><p>This site uses cookies to offer you a better browsing experience.<p><p>By continuing to use our site, you consent to the use of cookies.</p>',
yesButtonLabel: 'I agree',
noButtonLabel: 'Manage cookies'
}, null, manageCookies)
This will display the following alert window in the user interface: