title: Jquery UI dialog as confirmation
body: <pre><code>  function Globally() {
      $("#dialogid").dialog({ width: 300, modal: true, show: 'drop', hide: 'drop',
          buttons: {
              "Ok": function () { return true; $(this).dialog('close'); },
              "Cancel": function () { return false; $(this).dialog('close'); }
          }
      });
    }
  
    function test()
    {
      if(Globally())
        alert("Ok");
      else
        alert("Cancel");
    }
  </code></pre>
  
  <p>I am trying to make a confirmation dialog and I want it to placed in a function (in this case Globally()) because I am using confirmation dialog in so many different function, but this is not working , the control returns from the <code>Globally()</code> function without getting <code>true or false</code> value. I want it to stop there until user press <code>Ok or Cancel</code>. How can I do this?</p>