Confirm modal dialog in javascript

Is it possible to get a confirmation dialog with yes, there is no option instead of ok to cancel in javascript?

+2
javascript
Jul 02 '10 at 12:21
source share
4 answers

Do not use your own browser functions, no.

You will need to use your own dialog class, such as the jQuery dialog .

+5
Jul 02 2018-10-02T00:
source share

The default confirmation field is entered in the browser. But you can use modal dialogs with a little help from plugins like jQuery UI Dialog or BlockUI .

+2
Jul 02 '10 at 12:25
source share

Not using the built-in confirmation feature. You will need to use a special dialog. Fortunately, there are many good ones available, check out jQuery and its plugins.

+1
Jul 02 '10 at 12:25
source share
$('<div></div>').appendTo('body') .html('<div><h6>Are you sure?</h6></div>') .dialog({ modal: true, title: 'Delete message', zIndex: 10000, autoOpen: true, width: 'auto', resizable: false, buttons: { Yes: function () { // $(obj).removeAttr('onclick'); // $(obj).parents('.Parent').remove(); $(this).dialog("close"); }, No: function () { $(this).dialog("close"); } }, close: function (event, ui) { $(this).remove(); } }); 

for demo :

0
Jan 04 '13 at 5:37
source share



All Articles