[eluser]mvdg27[/eluser]
Hi, one more thing I just came accross .. I'd also like to display the error message. But I'm stuck on how to get the error message created by the validation class dynamically in my function:
Code:
$this->objResponse->Assign($field."_status","innerHTML", '<img src="'.base_url().'graphics/error.gif');
$this->objResponse->Assign($field."_error","innerHTML", $this->CI->validation->username_error);
$this->objResponse->Assign($field."_error","style.display", 'block');
On the second line the fieldname 'username' is hardcoded now. I'd actually like to replace that with $field. But can't seem to figure out how to do that. I guess this is just a general PHP question, not specific to CI.
Thanks!