title: Function to return true in OnClick with SweetAlert
body: <p>Hi I'm doing a function in PHP, in which I ask for a confirmation to continue using SweetAlert, the idea is to use the onclick event, but the problem is I have no control, the message is displayed but does not expect confirmation in any of both cases, which are a form and a link.</p>
  
  <p>Code:</p>
  
  <pre><code>&lt;meta http-equiv="content-type" content="text/html; UTF-8" /&gt;
  
  &lt;script src="Scripts/jquery-1.4.4.min.js"&gt;&lt;/script&gt;
  &lt;script src="sweetalert/dist/sweetalert-dev.js"&gt;&lt;/script&gt;
  &lt;link rel="stylesheet" href="sweetalert/dist/sweetalert.css"&gt;
  
  &lt;body&gt;
  
  &lt;?php
  
  function ShowMessage($titulo,$contenido,$tipo) {
      if($tipo=="ok") {
          //
      }
      else if($tipo=="error") {
          //
      } else if($tipo=="ask") {
  echo "
  swal({
    title: '$titulo',
    text: '$contenido',
    type: 'warning',
    showCancelButton: true,
    confirmButtonColor: '#DD6B55',
    confirmButtonText: 'Yes, delete it!',
    cancelButtonText: 'No, cancel plx!',
    closeOnConfirm: false,
    closeOnCancel: false
  },
  function(isConfirm){
    if (isConfirm) {
      return true;
    } else {
      return false;
    }
  });
  ";
      } else {
  
      }
  }
  
  ?&gt;
  
  &lt;a href='http://www.google.com' onClick="&lt;?php ShowMessage("test","test","ask"); ?&gt;"&gt;Go&lt;/a&gt;
  
  &lt;form action="http://www.google.com"&gt;
  &lt;input type="submit" name="none" text="test" onClick="&lt;?php ShowMessage("test","test","ask"); ?&gt;"&gt;
  &lt;/form&gt;
  
  &lt;/body&gt;
  </code></pre>
  
  <p>Someone could help me?</p>