Report issues on the [Apache Cordova issue tracker](https://issues.apache.org/jira/issues/?jql=project%20%3D%20CB%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20AND%20resolution%20%3D%20Unresolved%20AND%20component%20%3D%20%22Plugin%20Dialogs%22%20ORDER%20BY%20priority%20DESC%2C%20summary%20ASC%2C%20updatedDate%20DESC)
- __confirmCallback__: Callback to invoke with index of button pressed (1, 2, or 3) or when the dialog is dismissed without a button press (0). _(Function)_
- __title__: Dialog title. _(String)_ (Optional, defaults to `Confirm`)
- __buttonLabels__: Array of strings specifying button labels. _(Array)_ (Optional, defaults to [`OK,Cancel`])
### confirmCallback
The `confirmCallback` executes when the user presses one of the
buttons in the confirmation dialog box.
The callback takes the argument `buttonIndex`_(Number)_, which is the
index of the pressed button. Note that the index uses one-based
indexing, so the value is `1`, `2`, `3`, etc.
### Example
function onConfirm(buttonIndex) {
alert('You selected button ' + buttonIndex);
}
navigator.notification.confirm(
'You are the winner!', // message
onConfirm, // callback to invoke with index of button pressed
'Game Over', // title
['Restart','Exit'] // buttonLabels
);
### Supported Platforms
- Amazon Fire OS
- Android
- BlackBerry 10
- Firefox OS
- iOS
- Tizen
- Windows Phone 7 and 8
- Windows 8
- Windows
### Windows Phone 7 and 8 Quirks
- There is no built-in browser function for `window.confirm`, but you can bind it by assigning:
window.confirm = navigator.notification.confirm;
- Calls to `alert` and `confirm` are non-blocking, so the result is only available asynchronously.
### Windows Quirks
- On Windows8/8.1 it is not possible to add more than three buttons to MessageDialog instance.
- On Windows Phone 8.1 it's not possible to show dialog with more than two buttons.
### Firefox OS Quirks:
Both native-blocking `window.confirm()` and non-blocking `navigator.notification.confirm()` are available.
## navigator.notification.prompt
Displays a native dialog box that is more customizable than the browser's `prompt` function.
- __promptCallback__: Callback to invoke with index of button pressed (1, 2, or 3) or when the dialog is dismissed without a button press (0). _(Function)_
- __title__: Dialog title _(String)_ (Optional, defaults to `Prompt`)
- __buttonLabels__: Array of strings specifying button labels _(Array)_ (Optional, defaults to `["OK","Cancel"]`)