[eluser]LifeSteala[/eluser]
Hey guys - trying to validate a registration form which works but what I want it to do does not. The form accepts a home phone and a cell phone. Either one of those fields must be filled so I've created a callback function but I always get "Field is required!".
Code:
// Set Validation Rules
$rules['phone'] = "trim|required|callback__phoneCheck";
$this->validation->set_rules($rules);
// Callback Function
// Function: phoneCheck - Private
// Check to see if phone or mobile is entered
//-----------------------------------------------------------
function _phoneCheck($number)
{
if ( $this->input->post('phone') != "" && $this->input->post('mobile') != "" )
return false;
else
return true;
}
I figured if both values are empty then return false.. Any ideas?
Thanks!