Welcome Guest, Not a member yet? Register   Sign In
Error messages for callable checks in form validation
#1

[eluser]Patroklo[/eluser]
I'm using codeigniter 3, that lets you use callables instead of callbacks from the controller. But now I have the problem that I can't (don't know how to) send custom messages for this checks in my form, because those rules doesn't have a proper name and therefore I can't use the usual $this->form_validation->set_message('rule_name', 'message');

The code is something like this:

Code:
array( function($value){                    
                             // some way to send the message
       return FALSE;
                         },'callback_password_check'));

I have checked the code of Form_validation I downloaded from github and I have seen that the only feasible thing that I can do with the anonymous functions is changing the postdata value of the field, something that seems quite interesting but that I don't want to use right now.

So, do you know if there is any way of using callables the same way as callbacks or they only have the use of changing the value of the field? thanks!


Messages In This Thread
Error messages for callable checks in form validation - by El Forum - 08-13-2014, 04:53 AM
Error messages for callable checks in form validation - by El Forum - 08-13-2014, 10:13 AM
Error messages for callable checks in form validation - by El Forum - 08-13-2014, 10:46 AM
Error messages for callable checks in form validation - by El Forum - 08-13-2014, 11:04 AM
Error messages for callable checks in form validation - by El Forum - 08-13-2014, 11:27 AM



Theme © iAndrew 2016 - Forum software by © MyBB