Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14343

Custom validation rules with array input data

$
0
0
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

Viewing all articles
Browse latest Browse all 14343

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>