Welcome Guest, Not a member yet? Register   Sign In
Use Models, Libraries and Helpers in Form Validation rules
#3

[eluser]batfastad[/eluser]
This is an awesome idea. Something that should be available in the core really IMO.
It makes sense to keep shared validation callbacks in a helper rather than repeating across many controllers.

Question though... if I'm doing this with my callback stored in a helper, how do I set the error message within the helper?

Code:
$CI =& get_instance();
$CI->form_validation->set_message('external_callback', '%s field does not contain a valid date.');
... doesn't seem to work.

I get
Quote:Unable to access an error message corresponding to your field name.

Any ideas?

Cheers, B

EDIT: Ok everyone go home! The problem was... I was being an idiot!


Messages In This Thread
Use Models, Libraries and Helpers in Form Validation rules - by El Forum - 10-15-2012, 04:48 AM



Theme © iAndrew 2016 - Forum software by © MyBB