⚠ In case you've missed it we are migrating 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 forum is read-only and soon will be archived. ⚠

Uppercase, Lowercase or Capitalized text on input

uppercase lowercase capitalized input

  • Please log in to reply
3 replies to this topic

#1 fdias


    grocery CRUD Addict

  • Members
  • PipPipPip
  • 93 posts

Posted 13 July 2012 - 05:32 PM

I'm sharing here what I answered Anto on a support thread.

You can use this code when you wish the input is converted to uppercase, lowercase or capitalized letters.


On the crud method you use before render:


Callback function:

function callback_to_upper()
	return '<input type="text" name="fieldname" style="text-transform:uppercase;">';


On the crud method you use before render:


Callback function:

function callback_to_lower()
	return '<input type="text" name="fieldname" style="text-transform:lowercase;">';


On the crud method you use before render:


Callback function:

function callback_to_cap()
	return '<input type="text" name="fieldname" style="text-transform:capitalize;">';

Hope you like it!


#2 Robert


    Advanced Member

  • Members
  • PipPipPip
  • 220 posts

Posted 18 June 2013 - 08:39 AM

Thanks for this  .. i used it to.

#3 edramirez


    Advanced Member

  • Members
  • PipPipPip
  • 63 posts

Posted 02 November 2013 - 05:36 PM

Doing it that way would make the data appear to be in uppercase or lowercase or capitalized. But the actual data stored would not be affected. Hence, if the code were included as above to make the data uppercase but the keyboard was in lowercase, the display would be in uppercase but the data stored into the table would be in lowercase. To store the data in uppercase, we would need to add the following:


1. before the render:



2. as a separate function to save as uppercase:

public function prepare($post_array)
$post_array['fieldname'] = strtoupper(trim($post_array['fieldname']));
return $post_array;

#4 lcoulon



  • Members
  • Pip
  • 5 posts

Posted 27 January 2019 - 10:45 PM



Is there a way to get several input fields changed to uppercase with a single callback ?


This works perfectly to changed ONE field only, but calling the callbacks several time does work at all if we try to get multiple fields (textboxes) ?


I need to more than one field modified but do not find the proper way to do it.


Could someone post any example showing how to do this please ?


Many thanks,

Also tagged with one or more of these keywords: uppercase, lowercase, capitalized, input

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users