Welcome Guest, Not a member yet? Register   Sign In
dynamic input fields validation in codeigniter
#4

You can still use the input posts during validation. For instance you can do something like:

PHP Code:
// Expecting this one
$this->form_validation->set_rules('ID1_first_name''First Name''trim|required|max_length[50]');

// Optionally might be submitted ones
if($this->input->post(ID2_first_name$this->form_validation->set_rules('ID2_first_name''First Name''trim|required|max_length[50]');
if(
$this->input->post(ID3_first_name$this->form_validation->set_rules('ID3_first_name''First Name''trim|required|max_length[50]');
if(
$this->input->post(ID4_first_name$this->form_validation->set_rules('ID4_first_name''First Name''trim|required|max_length[50]');
if(
$this->input->post(ID5_first_name$this->form_validation->set_rules('ID5_first_name''First Name''trim|required|max_length[50]'); 

Then if they are posted they are validated.

Best wishes,

Paul.
Reply


Messages In This Thread
RE: dynamic input fields validation in codeigniter - by PaulD - 07-16-2016, 02:54 PM



Theme © iAndrew 2016 - Forum software by © MyBB