• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Validation Error being Processed but not displayed.

Please just take this example as there might be a simple answer Im not aware of.

function extra_fields($form,$data)
    { $this->load->library('validation');
      $sql = "SELECT * FROM prefix_extra_fields WHERE form = '".$form."'";
      $query = $this->db->query($sql, array());
      $build ="";  //gives build an initial value of blank
            foreach ($query->result() as $row)
            {     //  text input
                     $error_validation = $name."_error";
                             <td class="form_label">'.$name.':</td>
                            <td class="form_input">'.$this->validation->$error_validation.'&lt;input type="text" name="'.$name.'" value="'.$this-&gt;validation->$name.'" size="50" /></td>    
                 }// end text input
RETURN $build;

What this example does is gets any extra fields for this particular form as $form lets say 'user_register'.

I have a validation system running and working but the error message will not parse to the view.

In the above code example '$this->validation->$name' is being parsed to the view, no problem, but $this->validation->$error_validation will not parse.

Lets say $error_validation = 'username_error', this simply does not parse the expected error to my view. However if I placed the code $this->validation->username_error directly into my view page, any error can be seen, so Im certain the validation system I have is working 100%.

If anyone who is clever knows why a validation_error cant be parsed from a function then please let me know. This is almost complete now and I am willing to share the system... if I can get it to work properly.

Problem fixed,


Added this to my validation function

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.