title: Smooth login without javascript
body: <p><strong>What i want:</strong> clicking on login / pressing on enter will validate the login and redirect if correct (without javascript).</p>
  
  <p><strong>What i tried:</strong> </p>
  
  <ol>
  <li>A form with a submit button and validating on an other php page <strong>PROBLEM:</strong> if login is not correct, i don't want to redirect and display an error message instead.</li>
  </ol>
  
  <blockquote>
  <pre><code>&lt;form action="loginServerside.php" method='POST'&gt;
  </code></pre>
  </blockquote>
  
  <ol start="2">
  <li>A form with a submit button and validating when the submit button is set.
  <strong>PROBLEM:</strong> submit button reloads page and then redirects if login was correct</li>
  </ol>
  
  <blockquote>
  <pre><code>&lt;form method='POST'&gt;
        &lt;input name="email" type="email" id="email" placeholder="Email" /&gt;
        &lt;input name="pass" type="password" id="pass" placeholder="Password"&gt;
        &lt;input type="submit" name='login' value="LOGIN" id="login" class="button"/&gt;
  &lt;/form&gt;
  if (isset($_POST['login']))
       /*validate*/
  </code></pre>
  </blockquote>
  
  <ol start="3">
  <li>Trying to prevent the page reload by using an input type="button" <strong>PROBLEM:</strong> the isset only works for submit buttons</li>
  </ol>
  
  <p>I would appreciate the help!</p>