Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show jquery dialog with ok button? [closed]

Tags:

jquery

Here's my code:

$("#success").dialog({
    modal: true,
    title: 'Payment success',
    width: 400,
});

How can I show an OK button in this dialog?

like image 480
saravanan mp Avatar asked Dec 01 '22 19:12

saravanan mp


2 Answers

Use Buttons option and see the Modal Message.

$("#success").dialog({
  modal:true,
  title:'Payment success',
  width:400,
  buttons: {
    Ok: function() {
      $( this ).dialog( "close" );
    }
  }
});
like image 163
Suresh Atta Avatar answered Dec 27 '22 19:12

Suresh Atta


$("#success").dialog({modal:true,title:'Payment success',width:400,buttons{"Ok":execute,"Cancel": cancel}});

var execute = function()
{
    alert('This is Ok button');
}

var cancel = function()
{
    alert('This is Cancel button');
}

That should work.

like image 41
Magnus Avatar answered Dec 27 '22 18:12

Magnus