Link to home
Start Free TrialLog in
Avatar of brgdotnet
brgdotnetFlag for United States of America

asked on

How to change buttons on JQuery modal dialog box.

This is the exact code I am using to display a JQuery dialog box. It works great, however it displays two buttons. One labeled "Yes" and another labeled "No". I only need one button on
the Dialog box, and I need it to be labeled as "Ok". Is there any way to only have one button, and to have the text read as "Ok". How can I do that?

function displayDialogBox() {
 $('<div></div>').appendTo('body')
  .html('<div><h6>Alert </h6>
   .dialog({
                      modal:true, title: 'Did not perform process', zIndex:10000, autoOpen: true,
                      width: '600', resizable: false,
                      buttons: {
                                        Yes: function() {
                                         $(this).dialog("close");
                                          Reset();
                                       },
                                       No: function() {
                                         $(this).dialog("close");
                                                       Reset();
                                       }
                                   });

function Reset()
{
   // Code not shown
}
ASKER CERTIFIED SOLUTION
Avatar of Branislav Borojevic
Branislav Borojevic
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of brgdotnet

ASKER

Hello Sir, I tried that earlier today, and it did not work. Possibly someone else has a recommendation.
Can you reveal more of the code?

What is the alert for?

Maybe I can suggest a different solution to get the same result.

SIncerely,

Branislav
Thank you Sir. I will try some things and get back with you.
Thank you. I think the Capitalization of the OK, (Instead of Ok) did the trick. Not sure. It works now though. I will dig into the guts of the code on Monday. Thank you.