Welcome Guest, Not a member yet? Register   Sign In
Validation Error being Processed but not displayed.
#1

[eluser]maffo[/eluser]
Please just take this example as there might be a simple answer Im not aware of.

Code:
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
                if($row->type=="text"){  
                  
                    $name=$row->name;
                     $error_validation = $name."_error";
                $build.='<tr>
                             <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>    
                         </tr>';
                 }// 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.


Messages In This Thread
Validation Error being Processed but not displayed. - by El Forum - 07-01-2007, 04:50 PM
Validation Error being Processed but not displayed. - by El Forum - 07-01-2007, 05:30 PM



Theme © iAndrew 2016 - Forum software by © MyBB