title: Custom javascript confirm dialog box
body: <p>I have a function called <code>showModalConfirmDialog</code> that creates a custom javascript made dialog box with two buttons Yes/No and dims the background. Now in my functions I want to call that function like:</p>
  
  <pre><code>var outcome = showModalConfirmDialog('Are you sure?');
  </code></pre>
  
  <p>and I want to react depending on the button clicked;</p>
  
  <pre><code>if(outcome == true){
      // do something
  } else {
      // do something else
  }
  </code></pre>
  
  <p>The buttons return true/false.
  Javascript code:</p>
  
  <pre><code>button1.onclick = function(evt){
      return true;
  };
  
  button2.onclick = function(evt){
      return false;
  };
  </code></pre>
  
  <p>I don't know what I am missing, any help would be appreciated. Thanks</p>