Welcome Guest, Not a member yet? Register   Sign In
$this->validator->getValidated() looks stupid and unnecessary
#14

(10-11-2023, 03:54 PM)kenjis Wrote:
(10-11-2023, 03:00 PM)Inc33 Wrote: There could be many examples. One that comes to mind, is an address field. Validating address fields is only asking for trouble...

No, it has max length. At least it should be checked.

If the address is longer than your column length, you cannot save it to the database.
If it is too long, e.g., more than 1,000 characters, it must be invalid.

If it has invisible characters, it also is probably invalid.
If you expect English alphabets and 1-9 numbers, Chinese characters are invalid.

Hey @kenjis What do you think about my example ? the checkbox example? 
Of cause we can add in_list type or some other validation rule but then we have to add hidden input field for that checkbox.
Reply


Messages In This Thread
RE: $this->validator->getValidated() looks stupid and unnecessary - by MrWhite - 10-14-2023, 11:36 AM



Theme © iAndrew 2016 - Forum software by © MyBB