Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

Merge two text fields into a third text field

Avatar

Level 1

I have a form that asks for a person's date of birth and the last five digits of their social security number. I would like to create an invisible text field that merges the information from both fields, thus creating a unique participant ID. Is this something that can be done in LiveCycle?

1 Reply

Avatar

Level 10

Hi,

Yes, the following in the calculate event of the hidden field (JavaScript):

this.rawValue = dob.rawValue + " " + ssn.rawValue;

If you would prefer FormCalc there is a concat function, which will achieve the same thing:

$ = Concat(dob, " ", ssn)

Note that if either of these are null, then you will get "null" in the hidden dield as well. For example of the dob field was null the hidden field would be "null 12345". If you want to avoid this you would need to test the fields.

Niall