title: I want to submit a form( without <form> tag ), when I press enter key on keyboard
body: <pre><code>&lt;input type="text" name="username" id="username" placeholder="Username" /&gt;
  &lt;input type="password" name="password" id="password" placeholder="Password" /&gt;
  &lt;input type="submit" name="submit" onclick="validLogin()" class="submit" value="Login"&gt;
  </code></pre>
  
  <p>This is my form, when ever I fill password field and then hit on enter key on key form should submit.</p>
  
  <p><strong>Edit:</strong> Form submission code</p>
  
  <pre><code>function validLogin(){ 
    var uname=$('#username').val(); 
    var password=$('#password').val(); 
    var dataString = 'uname='+ uname + '&amp;password='+ password; 
  
    $("#flash").show(); 
    $("#flash").fadeIn(400).html('&lt;img src="image/loading.gif" /&gt;');
    $.ajax({ 
      type: "POST", 
      url: "login.php", 
      data: dataString, 
      cache: false, 
      success: function(result){
        var result = trim(result);
        $("#flash").hide();
        if(result=='correct'){
          window.location='al‌​l_departments.php';
        }else{
          $("#errorMessage").html(result);
        } 
      }
    });
  } 
  </code></pre>