Expand my Community achievements bar.

SOLVED

How can I merge 3 or more individual text fields into an editable summary text field?

Avatar

Level 1

I am stuck and do not know where to begin. I am self taught in using Adobe LiveCycle and have found many answers here in the forums and via trial and error.

I cannot find or create the correct java script or form calc to feed multiple text fields into one text field.  My supervisor is asking me to do this for two sections of a form I created using Adobe LiveCycle Designer ES 8.2.

1)       Merge all 3 user entered text fields to an user editable summary text field at the end of the form.

2)       Merge all 24 user entered text fields to an user editable summary text field at the end of the form.

Since they are all individual text fields in response to various questions, I cannot use the global binding function. I do not want the summary text field to override the individual text fields.

Here is the java scripting I placed on Show: calculate* Language: javascript Run: at client

1) PDStrengthWeaknessComments.rawValue + "_" + OCStrengthWeaknessComments.rawValue + "_" + CEBAStrengthWeaknessComments.rawValue;

Needless to say, these instructions are not working on my form. Would someone with a lot of experience or an IT degree kindly help me?

1 Accepted Solution

Avatar

Correct answer by
Level 10

I suspect that you don't have the correct object references in the script.

If "PDStrengthWeaknessComments" is on a different page, then the script may look like:

this.rawValue = page1.mySubform.PDStrengthWeaknessComments.rawValue +...

If you select the overall assessment object and click into the script editor. Then scroll to the PDStrengthWeaknessComments object. Click the script editor again to make sure it is active. Then press and hold the Control key and hover the mouse over the PDStrengthWeaknessComments object. The mouse will change into a 'V'. With the Control key held, click the PDStrengthWeaknessComments object. LC Designer will insert the correct reference into the script for you.

Lastly, I would not use a minus sign "-" in object names. It will only confuse LC Designer.

Niall

View solution in original post

4 Replies

Avatar

Level 10

Hi,

It's nearly there. Looking at it yu are missing the front end of the script:

this.rawValue = PDStrengthWeaknessComments.rawValue + "_" + OCStrengthWeaknessComments.rawValue + "_"  + CEBAStrengthWeaknessComments.rawValue;

To make it editable, you would need to go to the Object > Value palette and make sure that it is set to "calculated - user can override".

Also in the current script if a user has not inputted a comment the summary may look like:

"Niall is great_null_null"

To avoid this you would need to check if the input fields are null and only include non-null fields in the summary.

Good luck,

Niall

Assure Dynamics

Avatar

Level 1

I just tried adding the front end as you suggested and confirmed that the Object > Value is set to "calculated - user can override" for the summary text field.

OverallAnalysisAppFeedback.rawValue = PDStrengthWeaknessComments.rawValue + "_" + OCStrengthWeaknessComments.rawValue + "_"  + CEBAStrengthWeaknessComments.rawValue;

I was still unsuccessful.

I opened the debugger and received the following information. I do not understand what AdobeLiveCycle is asking me to define.

PDStrengthWeaknessComments is not defined

1:XFA:GARP2011NewRecompeteSRW[0]:Page20-OverallAnalysisAppFeedback[0]:AllOverallAnalysis[0]:calculate

PDStrengthWeaknessComments is not defined

1:XFA:GARP2011NewRecompeteSRW[0]:Page20-OverallAnalysisAppFeedback[0]:AllOverallAnalysis[0]:calculate

Budget1Comments is not defined

1:XFA:GARP2011NewRecompeteSRW[0]:Page21-OverallAnalysisAppFeedback-Budget[0]:AlBudgetQs[0]:calculate

Budget1Comments is not defined

1:XFA:GARP2011NewRecompeteSRW[0]:Page21-OverallAnalysisAppFeedback-Budget[0]:AlBudgetQs[0]:calculate

Do you have any additional tips or suggestions?

Avatar

Correct answer by
Level 10

I suspect that you don't have the correct object references in the script.

If "PDStrengthWeaknessComments" is on a different page, then the script may look like:

this.rawValue = page1.mySubform.PDStrengthWeaknessComments.rawValue +...

If you select the overall assessment object and click into the script editor. Then scroll to the PDStrengthWeaknessComments object. Click the script editor again to make sure it is active. Then press and hold the Control key and hover the mouse over the PDStrengthWeaknessComments object. The mouse will change into a 'V'. With the Control key held, click the PDStrengthWeaknessComments object. LC Designer will insert the correct reference into the script for you.

Lastly, I would not use a minus sign "-" in object names. It will only confuse LC Designer.

Niall

Avatar

Level 1

Thank you! Thank you! Thank you!

The fields were on various pages.  I also took your advice and removed all of the minus signs in the object names.

I really appreciate your assistance. I hope you have a great weekend.