How to force ALLCAPS in Date/Time Field | Community
Skip to main content
Feb 8, 2012 5:34 PM UTC
Solved

How to force ALLCAPS in Date/Time Field

I have searched in google for this and i found this

     // Current Date in MMM DD, YYYY style in uppercase.

     $.rawValue = Upper(num2date(date(), "DDMMMYY"))



but i don't want the current date, i want the date i select in the Date/Time Field.



i tried this but it didn't work



    $.rawValue = Upper($.rawValue)

can someone help me?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
whyisthisme
whyisthismeAccepted solution
Level 8
Feb 8, 2012 9:46 PM UTC

In the exit event for the date/time field put (in Formcalc):

$ = Upper($.formattedValue)

just make usre you have specified the dsiplay pattern you want in the object palette.

8 replies

Level 2
Jul 7, 2016 2:01 PM UTC

This looks like a valid solution for a single field/value, but is there an easier way to force ALL field values on a form to be uppercase? Perhaps at the form or master page level? I'd prefer not to have to add uppercase script to each field on my form, if possible.

Translate
New Participant
Jul 20, 2023 6:10 PM UTC

For whom the code did'nt work try putting the codes mentioned

(for Javascript)

 

this.rawValue = this.formattedValue.toUpperCase();   

 

in Initialize event.

 

This has been verified to work only when we just bind the data, not talking about changing or inputing in interactive adobe forms.

Translate
Level 3
Jul 23, 2013 2:31 PM UTC

This works great but the date validation fails with this code in there (either formcalc or java) . I even took away all the validation filters and it still fails. This is annoying.

I just want an upper case MONTH YEAR that will pass without an error off a date drop down or user entry.

Thank you if anyone has a solution.

Translate
Feb 9, 2012 10:06 AM UTC

thanks to everybody

     Formcalc:

               

Works -->          $ = Upper($.formattedValue)

     Javascript

    

Works -->          this.rawValue = this.formattedValue.toUpperCase();

once again thank you

Translate
Niall_O_Donovan
Level 10
Feb 8, 2012 11:44 PM UTC

Yeah Jono,

this.rawValue = this.formattedValue.toUpperCase();

...works!

Niall

Translate
Jono_Moore
Level 10
Feb 8, 2012 10:56 PM UTC

Yeah, those don't work on the date field - I was trying to figure it out but didn't think of trying the formattedValue!

Translate
Niall_O_Donovan
Level 10
Feb 8, 2012 9:48 PM UTC

Hi,

It depends on the language you are using: JavaScript or FormCalc in the Script Editor.

Upper is a FormCalc function, but .rawValue is JavaScript.

So if FormCalc try this in the exit event:

$ = Upper($);

if JavaScript try this in the exit event:

this.rawValue = this.rawValue.toUpperCase();

Hope that helps,

Niall

Good catch by whyisthisme, you probably have to use the Upper function on the formatted value.

Message was edited by: Niall O\'Donovan

Translate
whyisthisme
whyisthismeAccepted solution
Level 8
Feb 8, 2012 9:46 PM UTC

In the exit event for the date/time field put (in Formcalc):

$ = Upper($.formattedValue)

just make usre you have specified the dsiplay pattern you want in the object palette.

Translate