Welcome Guest, Not a member yet? Register   Sign In
editing post data before form_validation is run on it?
#1

[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.


Messages In This Thread
editing post data before form_validation is run on it? - by El Forum - 03-05-2012, 11:38 AM
editing post data before form_validation is run on it? - by El Forum - 03-05-2012, 11:48 AM
editing post data before form_validation is run on it? - by El Forum - 03-05-2012, 12:07 PM
editing post data before form_validation is run on it? - by El Forum - 03-05-2012, 12:36 PM
editing post data before form_validation is run on it? - by El Forum - 03-05-2012, 12:45 PM
editing post data before form_validation is run on it? - by El Forum - 03-05-2012, 01:06 PM



Theme © iAndrew 2016 - Forum software by © MyBB