Welcome Guest, Not a member yet? Register   Sign In
Form validation is_unique: valid if value is in current row, invalid on any other row
#6

Thanks for posting your solution BFlokstra! Are you validating in a config file or in the controller?

I've been trying to solve the same issue in the 'In Model' validation (i.e. setting the model property (array) $validationRules) like this:
Code:
protected $validationRules    = [
        'A_code' => 'required|alpha|exact_length[2]',
        'B_code' => 'required|is_natural|max_length[3]',
        'BB_code' => 'required|alpha|is_unique[bcca.BB_code,bcca.bcca_id,'.$id.']',
    ];

But I'm getting this error:
Code:
ErrorException #64
Constant expression contains invalid operations search →

APPPATH\Models\Administration\BccaModel.php at line 14

Anyone?
Reply


Messages In This Thread
RE: Form validation is_unique: valid if value is in current row, invalid on any other row - by Zeff - 01-24-2022, 08:16 AM



Theme © iAndrew 2016 - Forum software by © MyBB