Join fields and capitalize

New Here ,
Apr 29, 2021 Apr 29, 2021

Copy link to clipboard

Copied

I have two fields "name" and "grade".  Name is a standard text entry and grade is a drop down that allows the user to pick one grade.  The name is used in several places in my form.  Some of the places the name is proper case (example:  Tim Smith) and some spots it needs to be upper case (example: TIM SMITH).  I can do the upper and proper case no problem.  What I can't seem to figure out is how I can combine these two fields with the "name" field capitalized and the grade the same as it is in the drop down.  The field "grade" must always be as it is in the list.  The only way I see to do this is the toUpperCase method, which works but changes the grade.  When I do that I get - "TIM SMITH SGT", but I need it to say "TIM SMITH Sgt".  I thought about just placing two fields next to each other but this needs to be in a specific part of the form and with names being different sizes, it won't work.   Can anyone assist with this???

TOPICS
How to, JavaScript, PDF forms

Views

75

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct Answer

Adobe Community Professional , Apr 29, 2021 Apr 29, 2021
Set only first field to uppercase: event.value = this.getField("name").valueAsString.toUpperCase()+" "+this.getField("grade").valueAsString;

Likes

translate

Translate

Translate
Adobe Community Professional ,
Apr 29, 2021 Apr 29, 2021

Copy link to clipboard

Copied

Set only first field to uppercase:

event.value = this.getField("name").valueAsString.toUpperCase()+" "+this.getField("grade").valueAsString;

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 29, 2021 Apr 29, 2021

Copy link to clipboard

Copied

YES!!!  thank you

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines