Welcome Guest, Not a member yet? Register   Sign In
Form Validation - Error Message for Anonoymous Function
#1

How do I set an error message for an anonymous function used to validate a field when using the form validation class?

Code:


PHP Code:
$this->form_validation->set_rules('referral-code''Referral Code', 
                                    
array( 'required',
                                           
'regex_match[/^[a-zA-Z0-9]+$/]',
                                           function(
$value){
                                              
// validation of code
                                           
}),
                                     array(
'required'=>'Please enter a valid referral code',
                                           
'regex_match'=>'Invalid referral code',
                                            
'?? what goes here ??' => 'The code did not pass the test'
                                           

                                  ); 
Reply


Messages In This Thread
Form Validation - Error Message for Anonoymous Function - by deltatangodt - 08-31-2018, 07:09 PM



Theme © iAndrew 2016 - Forum software by © MyBB