Welcome Guest, Not a member yet? Register   Sign In
dynamic input field array validation.
#3

(08-09-2016, 06:41 PM)cartalot Wrote: note the brackets after the field name value

PHP Code:
       $formrules = array(
           array(
               'field' => 'fault[]',
               'label' => 'the fault field',
               'rules' => 'trim|max_length[40]'
           ),
 
       // and whatever else you need 
 
       );
        $this->form_validation->set_rules($formrules);

       if ($this->form_validation->run() == true)
       {return true; }
       else
       
{ return false; } 

Thanks mate this works.
Reply


Messages In This Thread
RE: dynamic input field array validation. - by greenarrow - 08-10-2016, 02:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB