• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Form Validation Config File

#1
Hello, I am new on this forum
I have problem with creating a form_validation.php file for entire application validation
I want custom error message for regex_match but. I got Default Error Validation Message

PHP Code:
//form validation regular expression
defined('NAME_EXP') OR define('NAME_EXP''[a-zA-Z .\-]+$');

'applicant' => [
    'field' => 'full_name',
    'label' => 'Applicant Name',
    'rules' => 'trim|required|max_length[255]|min_length[3]|regex_match[/' NAME_EXP '/]',
    'errors' => [
        'regex_match[/' NAME_EXP '/]' => "The %s field may only contain Alphabetic characters, Fullstops(.), Hyphens(-) and spaces( )."
    ]

Reply

#2
Hi, you should do it like this:

PHP Code:
'errors' => [
        
'regex_match' => ...
    ] 
Reply

#3
thank you. it works fine
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.