I’m showing a confirmation alert box through JavaScript:
function checked() {
if (hdnval.toLowerCase() != textbox1.toLowerCase()) {
var save = window.confirm('valid')
if (save == true)
{
return true;
}
else
{
return false;
}
}
}
The confirmation alert is showing with two buttons: OK and Cancel.
I want to show a third button in my confirmation alert. I want the three buttons to be like this: ‘Yes’ ‘No’ ‘Cancel’, as it shows in MS Word.
This cannot be done with the native javascript dialog box, but a lot of javascript libraries include more flexible dialogs. You can use something like jQuery UI’s dialog box for this.
See also these very similar questions:
Here’s an example, as demonstrated in this jsFiddle: