Simple way to convert af:inputText to upperCase,lowerCase,capitalize

Environment (JDeveloper 11.1.2.2.0,ADF Faces)

Sometimes you need to force the user to enter upperCase or lowerCase or capitalize letters for input text component. fortunately, there is an easy way to do this by setting contentStyle of the input text.

  • To enforce the user to enter upperCase text use this style:
<af:inputText label="Label 1" id="it1" contentStyle="text-transform:uppercase;"/>
  • To enforce the user to enter lowerCase text use this style:
<af:inputText label="Label 1" id="it1" contentStyle="text-transform:lowercase;"/>
  • To enforce the user to enter capitalize (InitCap) text use this style:
<af:inputText label="Label 1" id="it1" contentStyle="text-transform:capitalize;"/>
Advertisements

5 Comments

Filed under ADF

5 responses to “Simple way to convert af:inputText to upperCase,lowerCase,capitalize

  1. shanto

    Good solution. But a problem- when I used it, the input text works as mentioned above but on commit it doesn’t post changes to database,i.e it still remains in the entered format though it shows on the page as Uppercase/Capitalized. Is there a way it could post the changes using this way?

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