title: When i call function it's given me error. why?
body: <p><strong>The Error is Appearing</strong></p>
  
  <p>username function is not calling while i am giving value in it</p>
  
  <pre><code>Message: call_user_func_array() expects parameter 1 to be a valid callback, class 'Error' does not have a method 'index'
  </code></pre>
  
  <p>My javascript is:</p>
  
  <pre><code>email : { required : true, email : true, remote : { url : baseURL + "checkEmailExists", type :"post"} },
          username :{ required : true, remote : { url : baseURL + "checkUsernameExists", type :"post"} },
          password : { required : true },
  </code></pre>
  
  <p>My controller is:</p>
  
  <pre><code>function checkEmailExists()
  {
      $id = $this-&gt;input-&gt;post("id");
      $email = $this-&gt;input-&gt;post("email");
  
      if(empty($id)){
          $result1 = $this-&gt;user_model-&gt;checkEmailExists($email);
      } else {
          $result1 = $this-&gt;user_model-&gt;checkEmailExists($email, $id);
      }
  
      if(empty($result1)){ echo("true"); }
      else { echo("false"); }
  }
  
  function checkUsernameExists()
  {
      $id = $this-&gt;input-&gt;post("id");
      $username = $this-&gt;input-&gt;post("username");
  
      if(empty($id)){
          $result = $this-&gt;user_model-&gt;checkUsernameExists($username);
      } else {
          $result = $this-&gt;user_model-&gt;checkUsernameExists($username, $id);
      }
  
      if(empty($result)){ echo("true"); }
      else { echo("false"); }
  }
  </code></pre>
  
  <p>and my model is:</p>
  
  <pre><code>function checkEmailExists($email, $id = 0)
  {
      $this-&gt;db-&gt;select("email");
      $this-&gt;db-&gt;from("admins");
      $this-&gt;db-&gt;where("email", $email);   
      if($id != 0){
          $this-&gt;db-&gt;where("id !=", $id);
      }
      $query = $this-&gt;db-&gt;get();
  
      return $query-&gt;result();
  }
  
  function checkUsernameExists($username, $id = '')
  {
      $this-&gt;db-&gt;select("username");
      $this-&gt;db-&gt;from("admins");
      $this-&gt;db-&gt;where("username", $username);   
      if($id != ''){
          $this-&gt;db-&gt;where("id !=", $id);
      }
      $query1 = $this-&gt;db-&gt;get();
  
      echo '&lt;pre&gt;';
      print_r($query1);
      die();
  
      return $query1-&gt;result();
  }
  </code></pre>
  
  <p>And my View Part is:</p>
  
  <pre><code>&lt;div class="col-md-6"&gt;
                                  &lt;div class="form-group"&gt;
                                      &lt;label for="email"&gt;Email address&lt;/label&gt;&lt;span style="color: red"&gt;*&lt;/span&gt;
                                      &lt;input type="text" class="form-control required email" id="email"  name="email" maxlength="128"&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                              &lt;div class="col-md-6"&gt;
                                  &lt;div class="form-group"&gt;
                                      &lt;label for="username"&gt;User Name&lt;/label&gt;&lt;span style="color: red"&gt;*&lt;/span&gt;
                                      &lt;input type="text" class="form-control required" id="username"  name="username" maxlength="128"&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
  </code></pre>
  
  <p>my email validation is called perfectly but my username validation is not calling perfectly.
  It is showing the error of call_fun.....
  this is for check email or username is already exits or not</p>