Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

String Concatenation

Avatar

Level 2

Hi,

I have five text fields with name like Name_1, Name_2, Name_3, Name_4 and Name_5.

Each of these will contain just one character like A B C D  and E.

I want a 6 th text field (hidden) to have the full value as ABCDE after the user exits the text field Name_5.

form1.Fragment1.Name_5::mouseExit - (JavaScript, client)

var string1=form1.Fragment1.Name_1.rawValue;

var string2=form1.Fragment1.Name_2.rawValue;

var string3=form1.Fragment1.Name_3.rawValue;

var string4=form1.Fragment1.Name_4.rawValue;

var string5=form1.Fragment1.Name_5.rawValue;

var string6=form1.Fragment1.Name_6.rawValue; // This is blank presently.

form1.Fragment1.Name_6.rawValue = string6.concat(string1, string2, string3, string4, string5);

Please help me how would this work.

Thanks and Regards,

Sonika

1 Accepted Solution

Avatar

Correct answer by
Level 3

Here the update for the example.

Make sure the language is set to FormCalc. You were Mixing the language.

The last digit of the policy I placed an EXIT event to pass the value to Myfield in your form.

View solution in original post

10 Replies

Avatar

Level 2

Hi,

Thanks a lot! This was a very helpful.

Please help me by telling me what setting have you done.

On the last text field I did make it a calculated field and checked radio button as Calculated script but

looks like there is more because after updating PDF send by you the fragment I made works perfect but

if I start afresh it does not work.

Please guide.

Thanks and Regards,

Sonika

Avatar

Level 3

Can You Attach Your File So I Can See The Problem?

Avatar

Level 2

The textfield is not getting the value concatenated whereas the field copied from your form does. Am i missing some setting?

Please see attached.

Avatar

Level 10

The code must be of FormCalc (not Javascript)

See the modified PDF attached.

Also look at the new feature of Designer 8.x which make your life simple.

Nith

Avatar

Level 2

HI,

I know about the new feature but my requirement is what is done earlier.

Also, Please give me the equivalent javascript code, I cannot use Form Calc.

Thanks,

Sonika

Avatar

Correct answer by
Level 3

Here the update for the example.

Make sure the language is set to FormCalc. You were Mixing the language.

The last digit of the policy I placed an EXIT event to pass the value to Myfield in your form.