validate fields according option.
- Single Page
Posted 16 November 2014 - 05:11 AM
Posted 16 November 2014 - 10:33 AM
hi there
i will share you this piece of code thats there for validating confirm password if the password is set
$required_if = $this->input->post('new_password') ? '|required' : '' ;
$validation_check = $this->input->post('new_password') ? '|required|matches[confirm_passwd]' : '' ;
$crud->set_rules('confirm_passwd', 'New Password', 'trim'. $required_if);
$crud->set_rules('new_password', 'New Password Again', 'trim'.$validation_check);
This might help you understand the same. u might jet go through the same :)
Posted 16 November 2014 - 15:14 PM
perfect! I had not thought I did not think they could capture fields with $ this-> input-> post ();
$post=$this->input->post(); if($post['is_article']==1){ $crud->required_fields('title','text','is_article','image'); }else{ $crud->required_fields('title','is_article','image'); }
Thanks Amit Shah, Greetings from Chile!