title: jquery ui dialog box need to return value, when user presses button, but not working
body: <p>I'v got a jquery ui dialog box I want to use to prompt the user to confirm a deletion.  When the user presses "yes" or "no" I need to return "True" or "False" to continue some javascript execution.  The problem with the code below is when the dialog box shows up it immediately is executing a "return true;" but the user hasn't pressed the "Yes" button yet?</p>
  
  <p>What am I doing wrong?</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div id="modal_confirm_yes_no" title="Confirm"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Javascript call:</p>
  
  <pre><code>$("#modal_confirm_yes_no").html("Are you sure you want to delete this?");
  var answer = $("#modal_confirm_yes_no").dialog("open");
  
  if (answer)
  {
       //delete
  }
  else
  {
       //don't delete
  }
  </code></pre>
  
  <p>Jquery dialog:</p>
  
  <pre><code>$("#modal_confirm_yes_no").dialog({
                  bgiframe: true,
                  autoOpen: false,
                  minHeight: 200,
                  width: 350,
                  modal: true,
                  closeOnEscape: false,
                  draggable: false,
                  resizable: false,
                  buttons: {
                          'Yes': function(){
                              $(this).dialog('close');
                              return true;
                          },
                          'No': function(){
                              $(this).dialog('close');
                              return false;
                          }
                      }
              });
  </code></pre>