title: Creating a jQuery UI Dialog after click submit
body: <p>I have a form which calls <code>onSubmit="return report();"</code>. I have this javascript function in separate file. I would like to create my own jQuery UI Dialog instead of javascript confirm but I don't understand  jQuery at all. How should I change javascript function report() to obtain jQuery UI Dialog?</p>
  
  <p>There is part of my php file:</p>
  
  <pre><code>&lt;form method="POST" action="add.php" name="alert" id="alert" onSubmit="return report();"&gt;
      //some inputs
      &lt;button class='btn btn-primary' type='submit'&gt;Send it&lt;/button&gt;
  </code></pre>
  
  <p>And my js file:</p>
  
  <pre><code> function report() {
  
      var report="Some text: \n\n";
      //There is code in simple javascript
  
      raport=raport+"\n";
      raport=raport+"If the are no mistakes click OK";
      return confirm(report);
      }
  </code></pre>