Jump to content


Vitor Cricas

Member Since 17 Mar 2017
Offline Last Active Mar 17 2017 01:07 PM
-----

Posts I've Made

In Topic: Datepicker doesn't load when adding date with callback function on insert

17 March 2017 - 01:09 PM

datepicker won't work only if ALL date fields in add/edit view have callback_field.

If you have 2 date fields and only one of them has callback then it will work

 

callback example:

    function add_default_date($name){
        $value = date("d/m/Y");
        $return = '<input id="field-'.$name.'" name="'.$name.'" type="text" value="'.$value.'" maxlength="10" class="datepicker-input form-control"><a class="datepicker-input-clear" tabindex="-1">Limpar</a>(dd/mm/yyyy)';
        return $return;
    }

In Topic: Multiselect validation fails on v1.5.7

17 March 2017 - 01:02 PM

Yes it's true!

 

Workaround:

 

$crud->required_fields('multiselect_field');    

 

$crud->set_rules('multiselect_field', 'Title', 'required|callback_check_multiselect_field');

 

...

 

    function check_multiselect_field($value){

//value outputs nothing
        $values = $this->input->post('multiselect_field');
        if (!is_array($values)){
            $this->form_validation->set_message('check_multiselect_field', 'Field mandatory');            
            return false;
        }
        return true;
    }