Welcome Guest, Not a member yet? Register   Sign In
Custom validation rules with array input data
#1
Exclamation 

Hello, when using custom validation rules defined in MY_Form_validation on input fields with array data, the data is passed as a string to the validation function.

PHP Code:
<?php
defined
('BASEPATH') OR exit('No direct script access allowed');

class 
MY_Form_validation extends CI_Form_validation {

    function 
validate_data($data null) {
        
// $data is a string instead of an array
        
$data;
        
// Have to override it to access the original data
        
$data $this->CI->input->post('data[]');
    }
    
    


Just wanted to report
Reply




Theme © iAndrew 2016 - Forum software by © MyBB