title: Semantic UI: How to prevent form from being submitted when validation fails?
body: <p>I have a basic login form and I've specified the form validations and API call in my javascript file. The problem that I have is, when I click the login button and the form has errors, the invalid fields will be highlighted but the API call is still made, even though the form is invalid.</p>
  
  <p>Here's a simplified example:</p>
  
  <pre><code>&lt;form class="ui form"&gt;
    &lt;div class="field"&gt;
      &lt;input name="username" type="text" placeholder="Username" autofocus&gt;
    &lt;/div&gt;
    &lt;div class="field"&gt;
      &lt;input name="password" type="password" placeholder="Password"&gt;
    &lt;/div&gt;
    &lt;button type="submit" class="ui submit button"&gt;Login&lt;/button&gt;
    &lt;div class="ui error message"&gt;&lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <hr>
  
  <pre><code>$(function() {
  
      $('form').form({
          username: {
              identifier: 'username',
              rules: [{
                  type: 'empty',
                  prompt: 'Please enter your username'
              }]
          },
          password: {
              identifier: 'password',
              rules: [{
                  type: 'empty',
                  prompt: 'Please enter your password'
              }]
          }
      }, {
          onFailure: function() {
              // prevent form submission (doesn't work)
              return false;
          }
      });
  
      // *** this API call should not be made when the form is invalid ***
      $('form .submit.button').api({
          action: 'login',
          method: 'post',
          serializeForm: true,
          dataType: 'text',
          onSuccess: function() {
              // todo
          },
          onError: function() {
              // todo
          }
      });
  
  });
  </code></pre>
  
  <p>I also have a punkr <a href="http://plnkr.co/edit/ttLq1owlQLsLSpG6SUPy" rel="nofollow">here</a> which demonstrates the issue I'm having.</p>
  
  <p>Did I miss something? Are the <code>.api()</code> and <code>.form()</code> calls correct?</p>