xheradon, on 04 Apr 2017 - 09:26, said:
Well, you can use callback_add_field instead callback_before_insert returning the input with style="text-transform: uppercase;"
Anyways callback_before_insert should work, maybe the error is un your code.
Edit: It didn´t work that the text show it as uppercase but the data send as however you typed it.
$crud->unique_fields('service_tag','num_inventario');
...
$crud->callback_before_insert(array($this,'antesDeAgregarEquipo'));
...
public function antesDeAgregarEquipo($post_array) {
$post_array['service_tag']= strtoupper($post_array['service_tag']); //Método que convierne la cadena el service tag en mayusculas
return $post_array;
}
Here is my code, as you see I convert service tag into uppercase before insert the data into db
I FIXED IT, now it work with unique_fields function, I just changed the charset of db's fields to latin1. Now grocery crud check if service tag is repeated.