Home > ApEx, Javascript > Automatically converting text to uppercase

Automatically converting text to uppercase

ABCSometimes you want to force users to enter text into one of your ApEx page items in upper case. You can achieve this quite easily by adding the following bit of code to the HTML Form Element Attributes of your item:

onChange="this.value=this.value.toUpperCase();"

Or, if you want to force the text to lower case:

onChange="this.value=this.value.toLowerCase();"

Advertisements
Categories: ApEx, Javascript
  1. October 11, 2012 at 9:40 am

    Just what I needed, thanks

  2. Eve
    January 11, 2011 at 8:38 pm

    Can I use javascript to change the text in an item to Initcap?

  3. Milind Jadhav
    July 24, 2008 at 10:03 am

    This post is really helpful for me as new Apex Developer as I am more of Forms and Reports Background and for this, i was stuggling a lot to make it upper case. Thanks Andy once again and keep posting such a nice tips for APEX

  4. June 12, 2007 at 4:42 pm

    Or you just set the Case Restriction to “Uppercase” in the ApexLib Framework :-)

    And it will do everything for you, also the UPPER on the server side, just to be sure in case if someone tries to “hack” your application.

    Patrick

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: