[eluser]hamobi[/eluser]
I am running this validation on a form field for a phone number
Code:
$this->form_validation->set_rules('phone', 'Phone', 'trim|required|is_natural|exact_length[10]|xss_clean');
the problem is that the user is not able to enter dashes or parentheses. So I have been trying to strip those things before the data is ran through the validation function:
Code:
$phone = $this->input->post('phone');
$this->form_validation->set_rules($phone, 'Phone', 'trim|required|is_natural|exact_length[10]|xss_clean');
however, this it is now not validating the data at all. How am I able to make this happen?
thank you.