These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Need Help in Trying to Concatenate 2 Name Fields In Acrobat

PStewart92104
Registered: Dec 2 2011
Posts: 4
Answered

I have a field I'm naming TEXT1 which I want to populate with a concatenate of two values, GLOBAL_USER_FIRST_NAME and GLOBAL_USER_LAST_NAME. I am so new at this and stumbling around. If I name the Field "GLOBAL_USER_FIRST_NAME" it will populate with the User's first name, likewise for the last name. My goal is to have one field that will combine them both so it won't look so jacked up spacing-wise. I've tried using the Calculate/Custom calculation script section in the Text Field Properties and just keep striking out. I'm sure it's probably something simple, but I can't figure it out. Can anyone help me????

Peter

My Product Information:
Acrobat Pro 10.0, Windows
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1875
Accepted Answer
The simplest script would be something like:

// Custom Calculate script for TEXT1
event.value = getField("GLOBAL_USER_FIRST_NAME").valueAsString + " " + getField("GLOBAL_USER_LAST_NAME").valueAsString;

This could be refined to suppress the space if either of the input fields are blank, but this should get you started.
PStewart92104
Registered: Dec 2 2011
Posts: 4
Thank you George! I had done this, but then it dawned on me, that perhaps I actually need to have the two fields (last and first name) on the document. Once I had that and just put them to not be visible and print, VOILA!! You Rock!!!

Peter