title: How to show an error on pop up login page?
body: <p>my PHP application where users have to login on a popup login page that appears after pressing a button.
  <strong>The login button is as:</strong></p>
  
  <pre><code>&lt;div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"&gt;
      &lt;ul class="nav navbar-nav navbar-right main-nav"&gt;
          &lt;li&gt;&lt;a href="#intro"&gt;Intro&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#services"&gt;Services&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#team"&gt;Team&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#pricing"&gt;Pricing&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#modal1" data-toggle="modal" data-target="#modal1" class="btn btn-blue"&gt;Sign Up&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>the pop up login page is as</strong></p>
  
  <pre><code>&lt;div class="modal fade" id="modal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt;
      &lt;div class="modal-dialog"&gt;
          &lt;div class="modal-content modal-popup"&gt;
              &lt;a href="#" class="close-link"&gt;&lt;i class="icon_close_alt2"&gt;&lt;/i&gt;&lt;/a&gt;
              &lt;br /&gt;
              &lt;h3 class="white"&gt;Sign Up&lt;/h3&gt;
              &lt;?php if(validation_errors()){  ?&gt;
                  &lt;div class="alert alert-danger"&gt;
              &lt;?php echo validation_errors(); ?&gt;
                  &lt;/div&gt;
              &lt;?php } ?&gt;
  
              &lt;?php echo form_open('verifylogin/'); ?&gt;
                  &lt;form class="popup-form" action=""&gt;
                      &lt;input class="form-control form-white" placeholder="Username" name="username" type="text" autofocus  AutoComplete=off &gt;&lt;br /&gt;
                      &lt;input class="form-control form-white" placeholder="Password" name="password" type="password"  autocomplete=off  value=""&gt;      
                      &lt;button type="submit" class="btn btn-submit"&gt;Submit&lt;/button&gt;
                  &lt;/form&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>When credentials fail an error message is displayed only when the user presses the sign up button again instead of own self.</p>