Validate rule for if both fields are empty. - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Validate rule for if both fields are empty. (/showthread.php?tid=48146) |
Validate rule for if both fields are empty. - El Forum - 01-06-2012 [eluser]boltsabre[/eluser] Hi guys, hoping someone can point me in the correct direction here. I have a contact form, which includes an Email Address field and a Telephone field. Is there a way to check in my application/libraries/MY_Form_validation file for if both these fields are empty when my form validation runs? I've had a hunt, but haven't found anything too helpful. Sorry if this is dead easy, but I'm not the worlds greatest coder (but slowly getting better). Currently I have this: Code: //controller function, my rule is "phone_and_email_required", applied to both 'phone' and 'email' Code: // inside MY_Form_validation file But I'm not even getting into the function unless something is entered into one of the two fields first, kind of defeating the purpose of it in the first place!!! Any thoughts??? |