Automate Uppercase Input in text Fields

Tips submitted by PHPMaker users

Automate Uppercase Input in text Fields

Postby lUTGARDO » Mon May 07, 2012 6:30 pm

Due to a Custumer requirement, I needed to fill some Text Fileds Uppercase, no matter if Cap Lock is ON or OFF.
I found this solution, in tree steps.

1.- Add a CSS Stile line.
a.go to PHP Settings->HTML->STYLES
b. Click on "Edit Styles"
c. At the end , below the line /*BEGIN_USER_STYLES*/ add the following line:
.convertuppercase {text-transform:uppercase}

2.-On Clients Scripts Section choose Global ->Global Code and Add the following function:

function func_convert_uppercase(x) {
x.value = x.value.toUpperCase();

3. Choose the field you want to be Uppercase in your table
a. In custom attributes write 'class="convertuppercase" onchange="func_convert_uppercase(this)" autocomplete="off" '

NOTE: autocomplete="off" is just to avoid browser´s autocomplete option, because when you are typing a new value, previous typed values for this field are shown in a list.
If you select one of them, the value is saved as is shown , wheter if it is Upper case or Lower Case. (I don´t know Why)

I hope it is usefull for you

Re: Automate Uppercase Input in text Fields

Postby jleraj » Mon Feb 08, 2016 11:38 pm


It works for me
Posts: 11
Joined: Sun Sep 21, 2014 2:13 pm

Re: Automate Uppercase Input in text Fields

Postby wally » Wed Nov 09, 2016 4:58 pm

First of all, thanks lUTGARDO for your post.

How this is related to the same thing, I want to collaborate with another way that I found to do the same thing in one step only.
This way, also will transform the text independently if you will use or not the autocomplete feature, because will transfor all the text once is sent by the browser... ;-)
It resides in adding this line of code to Server Events > Table-Specific > Common > Row_Inserting and Row_Updating


Hope this will be usefull for others, the same way many times I've found solutions from the others.

Best regards.
Posts: 1
Joined: Wed Nov 09, 2016 4:40 pm

Re: Automate Uppercase Input in text Fields

Postby Summey » Mon Jun 12, 2017 4:31 pm

Perfect thanks Gardo.
Posts: 1
Joined: Tue Jun 06, 2017 10:58 pm

Re: Automate Uppercase Input in text Fields

Postby yinsw » Thu Jun 22, 2017 12:48 pm

I'm putting this under Client side events for the field that I want to be uppercase:

{ // keys = event types, values = handler functions
"change keyup": function(e) {
// Your code
this.value = this.value.toUpperCase();
Posts: 71
Joined: Wed Aug 19, 2015 4:17 pm

Return to User Submitted Tips (PHPMaker)