title: why submit on key enter not working
body: <p>I have a login form where if the input sn on focus and then you press enter it will prompt errors asking you to fill out the fields. But if you fill out both fields, no error comes out and even when you enter the correct credentials and then press enter. nothing happens. the form just gets reset. It works fine if I click the button though.</p>
  
  <p>I am using semantic ui as front-end framework and using its form validation for the errors. Is it because of semantic?</p>
  
  <p><a href="http://semantic-ui.com/behaviors/form.html" rel="nofollow">here</a> the link for semantic ui form validation's documentation</p>
  
  <p>Here is my form</p>
  
  <pre><code>&lt;form id="login" class="ui large form" method="post" action=""&gt;
      &lt;div class="ui stacked secondary  segment"&gt;
          &lt;div class="field"&gt;
              &lt;div class="ui left icon input"&gt;
                  &lt;i class="user icon"&gt;&lt;/i&gt;
                  &lt;input type="text" name="username" placeholder="Nama Pengguna"&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="field"&gt;
              &lt;div class="ui left icon input"&gt;
                  &lt;i class="lock icon"&gt;&lt;/i&gt;
                  &lt;input type="password" name="password" placeholder="Kata laluan"&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;input type="submit" name="btn-login" value="Log-masuk" class="ui fluid large teal submit button"&gt;
      &lt;/div&gt;
  
      &lt;div class="ui error message"&gt;&lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>and the javascript for it is </p>
  
  <pre><code>$(document).ready(function() {
      $('.ui.form').form({
          fields: {
              username: {
                  identifier: 'username',
                  rules: [{
                      type: 'empty',
                      prompt: 'Sila masukkan Nama Pengguna'
                  }]
              },
              password: {
                  identifier: 'password',
                  rules: [{
                      type: 'empty',
                      prompt: 'Sila masukkan Kata Laluan'
                  }]
              }
          }
      });
  });
  </code></pre>