Upper Case - String Field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2012 11:43 AM
What is the easiest way to make it so a string field convert into all upper case?
That way all of the text being entered can have all upper case letters.
Is there a way to have it automatically change to Upper case while the person is typing in even though they dont have CapsLock on? (Chances are they don't know it needs to be all upper case) Or maybe a on submit script would be easiest?
I saw the Field Normalization plugin might be a way to go. But if there is an easier way to do this, it would be much appreciated.
Thanks in advanced.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2012 11:58 AM
You could do it with an onChange Client Script on the field. Won't happen as they type, but will convert when they move to another field. In this example, the field is incident.short_description:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue == '')
return;
var str = newValue.toUpperCase();
if (str != newValue)
g_form.setValue("short_description", str);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2012 01:44 PM
This onload client script is currently running on the demo13 instance, change request form, short description field:
function onLoad() {
//Type appropriate comment here, and begin script below
var field = document.getElementById('change_request.short_description');
field.onkeyup=upperCase;
}
function upperCase() {
var x = document.getElementById('change_request.short_description');
x.value = x.value.toUpperCase();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2012 07:20 AM
These are exactly what I was looking for. Thanks for the help CapaJC and geoffcox.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2020 11:04 AM
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '')
return;
if (newValue.toUpperCase() != newValue)
g_form.setValue("field", newValue.toUpperCase());
}