In this tutorial, I am giving an example of just one line code to set an item value to the upper case in Oracle Apex.
Sometimes it is required for an item to get input in the upper case and store the data in the upper case as well.
In Oracle Apex, you can achieve this with the same one-line code for every item. No need to change anything for a different item, and it applies to interactive grid text fields too. To use this single line code to convert any text field to the upper case, follow these steps:
Set/Convert an Item Value to Upper Case in Oracle Apex
Open your page and click on the item for which you want to set as upper case. Then at the right side, in the Advanced
property section, paste the below code having CSS and JavaScript code in one line in the Customer Attributes
property:
style="text-transform: uppercase;" onKeyUp="this.value=this.value.toUpperCase();"
You can notice in the above code, it does not contain any specific item name or any static id of the element. So you can use this same code without any change for every text field for which you want it to convert into the upper case.
Below is the screenshot for the above setting:
Save the changes and run the page to test. Now when the user types the first name, it will convert every character to the upper case on key up using the JavaScript, and the same data will be stored in the database table. The CSS is used to display data in upper case on page load.
Hi Vinish. How can one solve the problem that if you want to modify the value that the cursor keeps jumping to the end of the string?