Is there a creative and easy way to check many form fields at once.
I have a form with generated fields on the fly, each has a unique id.
The thing is submitting all the fields are not required, but at least one field must be filled before submitting.
Is there a way to do this in Codeigniter, or how would I go about validating this effectively.
I understand that it is possible to check each field individually, but I’m seeking for a much cleaner way.
I hope it’s clear for you guys. Thanks.
Right now, I have a custom function which will batch check every submission on my form to make sure it meets a set of rules. I am thinking that it may work to set up my form as an html array (
data[]), retrieve it in code igniter, then use the CIcallback_validation function to make sure everything turns out okay. It seems complex, so I haven’t yet entirely wrapped my head around it, but maybe this can get your wheels turning in the right direction.EDIT:
Then, just write your custom validation function based on what it is that you need to validate.