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
#8

(This post was last modified: 01-25-2022, 01:55 AM by Zeff.)

(01-24-2022, 08:41 AM)iRedds Wrote: https://www.php.net/manual/en/language.o...erties.php
" but this initialization must be a constant value."
Thanks iRedds, I missed this one. I initialize $this->validationRules in my constructor now and the message has disappeared.
I followed the in model validation on https://codeigniter.com/user_guide/model...ating-data where the notation {id} is suggested (and apparently, this notation CAN be used in class property / so doesn't need to be set in the constructor).
But still, the is_unique() validation rule was not ignored during update for the given id...
My mistake: I forgot to add a hidden field in the form holding the id value  Blush
So: problem solved, thanks for the golden tip!
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-25-2022, 01:31 AM



Theme © iAndrew 2016 - Forum software by © MyBB