title: Validation on my form? "Please fill in required fields"
body: <p>I have a username form. Which have 2 fields, username and password.
  Basically I want it so if the user has not entered the fields and pressed 'submit' an error displays like
  "Please enter the required fields"</p>
  
  <p>I know it's possible with JavaScript or PHP but unsure how to do it.</p>
  
  <p>Here is the code of the user and password form:</p>
  
  <pre><code>&lt;div id="sessionContainer" class="clearfix"&gt;
    &lt;div class="content"&gt;
      &lt;form action="goto.php" class=" sign-in" method="post"&gt;
        &lt;div style="margin:0;padding:0"&gt;&lt;/div&gt;
        &lt;h3&gt;Enter Details&lt;/h3&gt;
        &lt;p&gt;&lt;font size="-1"&gt;Please enter your details&lt;/font&gt;&lt;/p&gt;&lt;br&gt;
        &lt;div class="clearfix"&gt;
          &lt;label for=""&gt;Username or email address&lt;/label&gt;&lt;br&gt;
          &lt;input class="xlarge" id="email" name="email" tabindex="1" type="text" value="" /&gt;
        &lt;/div&gt;
        &lt;div class="clearfix"&gt;
          &lt;label for=""&gt;&lt;br&gt;
            Password&lt;/label&gt;&lt;br&gt;
          &lt;input class="xlarge" id="password" name="password" tabindex="2" type="password" value="" /&gt;
        &lt;/div&gt;
  
  
        &lt;p class="remember"&gt;&amp;nbsp;&lt;/p&gt;
        &lt;p class="remember"&gt;
          &lt;button class="btn btn-m btn-blue" id="signin_submit" name="commit" type="submit" tabindex=5&gt;Sign in&lt;/button&gt;
        &lt;/p&gt;
  </code></pre>
  
  <p>Thanks</p>