$crud->callback_add_field('fieldname',array($this,'callback_to_cap'));
$crud->callback_before_insert(array($this,'insert')); then cappitalized the text
I dont have any input text im using grocery crud
...please help me. :(
⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠
Posted 17 February 2014 - 20:16 PM
$crud->callback_add_field('fieldname',array($this,'callback_to_cap'));
$crud->callback_before_insert(array($this,'insert')); then cappitalized the text
I dont have any input text im using grocery crud
...please help me. :(
Posted 20 February 2014 - 15:22 PM
You want only when adding the text to have it upper or on DB to ?
If you want only when users type do this :
$crud->callback_field('fieldname', array($this,'_callback_fieldname'));
public function _callback_fieldname($value = '', $primary_key = NULL) { return '<input type="text" name="fieldname" id="fieldname" style="text-transform:uppercase;">'; }
Posted 20 February 2014 - 15:31 PM
In DB to
$crud->callback_before_insert(array($this, '_uppercase_function')); $crud->callback_before_update(array($this, '_uppercase_function'));
function _uppercase_function($post_array) { $post_array['fieldname'] = strtoupper($post_array['fieldname']); ...... return $post_array; }
Posted 20 February 2014 - 21:36 PM
Thanks Robert....now my project is working