Welcome Guest, Not a member yet? Register   Sign In
Form Validation Any One Of 5 Inputs Required
#1

[eluser]Kebabman[/eluser]
Using the standard CI form validation procedures is it possible to require any one of 5 inputs? For example is it possible to have 5 text areas and for validation to succeed any one of those 5 (or more) can have text in it. The only requirement is that not all of the text areas are empty, if that makes any sense...
#2

[eluser]CroNiX[/eluser]
Sure, you can just use a callback and in the callback function check all 5 fields using $this->input->post(field) and if any one of them has data, it passes the rule.
#3

[eluser]Kebabman[/eluser]
Ah right ok, great. Thanks for the reply, I will look into the specifics of callbacks.
#4

[eluser]Kebabman[/eluser]
All working now, thanks again for the tip!




Theme © iAndrew 2016 - Forum software by © MyBB