I want to validate landphone and mobile phone fields in my CI application. I have set validation rules as integer but user cannot enter values seperated by " - " . If i use "text" type, user can enter alphabets also.....how do i solve this issue....i want user to enter "-" and "+" values in the fields and not any other texts
Code:
$this->form_validation->set_rules('land_phone','Land Phone','trim|required|integer|min_length[1]|max_length[50]|xss_clean');
$this->form_validation->set_rules('mobile_phone','Mobile Phone','trim|required|integer|min_length[1]|max_length[50]|xss_clean');